Problem Statement
An electronic billboard is supposed to display large letters by using several lightbulbs per letter. Given a message, and how each enlarged letter looks as a 5x5 arrangement of lightbulbs, return the enlarged message.
The enlarged representation of the letters will be in a
"<letter>:*****-*****-*****-*****-*****"
Where <letter> is a single uppercase letter [A-Z], and each * is either the character '#' (representing a lit lightbulb) or a period ('.') (representing an unlit lightbulb). Each group of 5 (delimited by a dash, '-') represents a row in the 5x5 representation of the letter. So, "T:#####-..#..-..#..-..#..-..#.." means that the 5x5 representation of 'T' is:
"#####" "..#.." "..#.." "..#.." "..#.."
Return the enlarged message as a 5-element
Definition
- Class:
- Billboard
- Method:
- enlarge
- Parameters:
- String, String[]
- Returns:
- String[]
- Method signature:
- String[] enlarge(String message, String[] letters)
- (be sure your method is public)
Constraints
- message will contain between 1 and 10 characters, inclusive.
- each character of message will be an uppercase letter [A-Z].
- letters will contain between 1 and 10 elements, inclusive.
- each element of letters will be exactly 31 characters in length.
- each element of letters will be formatted as (quotes added for clarity): "
:*****-*****-*****-*****-*****", where is a single uppercase letter [A-Z] (inclusive) representing the letter being enlarged, and each * is either the character '#' or a period. - every letter appearing in message will have an enlarged representation in letters.
- each letter represented in letters will be unique.
Examples
"TOPCODER"
{"T:#####-..#..-..#..-..#..-..#.." ,"O:#####-#...#-#...#-#...#-#####" ,"P:####.-#...#-####.-#....-#...." ,"C:.####-#....-#....-#....-.####" ,"D:####.-#...#-#...#-#...#-####." ,"E:#####-#....-####.-#....-#####" ,"R:####.-#...#-####.-#.#..-#..##"}
Returns: { "#####.#####.####...####.#####.####..#####.####.", "..#...#...#.#...#.#.....#...#.#...#.#.....#...#", "..#...#...#.####..#.....#...#.#...#.####..####.", "..#...#...#.#.....#.....#...#.#...#.#.....#.#..", "..#...#####.#......####.#####.####..#####.#..##" }
"DOK"
{"D:####.-#...#-#...#-#...#-####." ,"O:#####-#...#-#...#-#...#-#####" ,"K:#...#-#..#.-###..-#..#.-#...#"}
Returns: { "####..#####.#...#", "#...#.#...#.#..#.", "#...#.#...#.###..", "#...#.#...#.#..#.", "####..#####.#...#" }
"RANDOMNESS"
{"S:##.##-#####-#.#.#-#.#.#-####." ,"N:#####-#####-#####-#####-#####" ,"R:#####-#####-##.##-#####-#####" ,"A:.....-.....-.....-.....-....." ,"D:#.#.#-.#.#.-#.#.#-.#.#.-#.#.#" ,"O:#####-#...#-#.#.#-#...#-#####" ,"E:#....-.#...-..#..-...#.-....#" ,"M:#....-.....-.....-.....-....." ,"X:#...#-.#.#.-..#..-.#.#.-#...#"}
Returns: { "#####.......#####.#.#.#.#####.#.....#####.#.....##.##.##.##", "#####.......#####..#.#..#...#.......#####..#....#####.#####", "##.##.......#####.#.#.#.#.#.#.......#####...#...#.#.#.#.#.#", "#####.......#####..#.#..#...#.......#####....#..#.#.#.#.#.#", "#####.......#####.#.#.#.#####.......#####.....#.####..####." }
Note that the letter X is defined but never used.
"ABCDE"
{"A:..#..-.#.#.-#####-#...#-#...#","B:####.-#...#-####.-#...#-####.","C:#####-#....-#....-#....-#####","D:####.-#...#-#...#-#...#-####.","E:#####-#....-####.-#....-#####"}
Returns: { "..#...####..#####.####..#####", ".#.#..#...#.#.....#...#.#....", "#####.####..#.....#...#.####.", "#...#.#...#.#.....#...#.#....", "#...#.####..#####.####..#####" }
"SKINNY"
{"S:..##.-.#...-..#..-...#.-.##..","K:.#.#.-.##..-.#...-.##..-.#.#.","I:.###.-..#..-..#..-..#..-.###.","N:.#.#.-.###.-.###.-.###.-.#.#.","Y:.#.#.-.#.#.-..#..-..#..-..#.."}
Returns: { "..##...#.#...###...#.#...#.#...#.#.", ".#.....##.....#....###...###...#.#.", "..#....#......#....###...###....#..", "...#...##.....#....###...###....#..", ".##....#.#...###...#.#...#.#....#.." }
"ODED"
{"O:#####-#...#-#...#-#...#-#####","D:####.-#...#-#...#-#...#-####.","E:#####-#....-####.-#....-#####"}
Returns: { "#####.####..#####.####.", "#...#.#...#.#.....#...#", "#...#.#...#.####..#...#", "#...#.#...#.#.....#...#", "#####.####..#####.####." }
"LARS"
{"L:#....-#....-#....-#....-#####","A:..#..-.#.#.-#####-#...#-#...#","R:####.-#...#-####.-#..#.-#...#","S:..##.-.#...-..#..-...#.-.##.."}
Returns: { "#.......#...####....##.", "#......#.#..#...#..#...", "#.....#####.####....#..", "#.....#...#.#..#.....#.", "#####.#...#.#...#..##.." }
"ABBA"
{"A:####.-#...#-####.-#...#-####.","B:..#..-.#.#.-#####-#...#-#...#"}
Returns: { "####....#.....#...####.", "#...#..#.#...#.#..#...#", "####..#####.#####.####.", "#...#.#...#.#...#.#...#", "####..#...#.#...#.####." }
"TRIANGLE"
{"T:.....-..#..-.#.#.-#####-.....","R:.....-..#..-.#.#.-#####-.....","I:.....-..#..-.#.#.-#####-.....","A:.....-..#..-.#.#.-#####-.....","N:.....-..#..-.#.#.-#####-.....","G:.....-..#..-.#.#.-#####-.....","L:.....-..#..-.#.#.-#####-.....","E:.....-..#..-.#.#.-#####-....."}
Returns: { "...............................................", "..#.....#.....#.....#.....#.....#.....#.....#..", ".#.#...#.#...#.#...#.#...#.#...#.#...#.#...#.#.", "#####.#####.#####.#####.#####.#####.#####.#####", "..............................................." }
"XXXXXXXX"
{"X:#...#-.#.#.-..#..-.#.#.-#...#","Y:###.#-#.#.#-..###-#####-....#"}
Returns: { "#...#.#...#.#...#.#...#.#...#.#...#.#...#.#...#", ".#.#...#.#...#.#...#.#...#.#...#.#...#.#...#.#.", "..#.....#.....#.....#.....#.....#.....#.....#..", ".#.#...#.#...#.#...#.#...#.#...#.#...#.#...#.#.", "#...#.#...#.#...#.#...#.#...#.#...#.#...#.#...#" }
"NSF"
{"N:#...#-##..#-#.#.#-#..##-#...#","S:.###.-#....-####.-#...#-.###.","F:..#..-.##..-#####-..#..-..#.."}
Returns: { "#...#..###....#..", "##..#.#......##..", "#.#.#.####..#####", "#..##.#...#...#..", "#...#..###....#.." }
"PST"
{"P:####.-#...#-####.-#....-#....","S:.####-#....-.###.-....#-####.","T:.###.-#...#-..##.-.#...-#####"}
Returns: { "####...####..###.", "#...#.#.....#...#", "####...###....##.", "#.........#..#...", "#.....####..#####" }
"XBOX"
{"X:#...#-.#.#.-..#..-.#.#.-#...#","B:####.-#...#-####.-#...#-####.","O:.###.-#...#-#...#-#...#-.###."}
Returns: { "#...#.####...###..#...#", ".#.#..#...#.#...#..#.#.", "..#...####..#...#...#..", ".#.#..#...#.#...#..#.#.", "#...#.####...###..#...#" }
"SNES"
{"S:.####-#....-.###.-....#-####.","N:#...#-##..#-#.#.#-#..##-#...#","E:#####-#....-####.-#....-#####"}
Returns: { ".####.#...#.#####..####", "#.....##..#.#.....#....", ".###..#.#.#.####...###.", "....#.#..##.#.........#", "####..#...#.#####.####." }
"TEQUILA"
{"T:#####-..#..-..#..-..#..-..#..","E:#####-#....-####.-#....-#####","Q:####.-#..#.-#..#.-#..#.-#####","U:#...#-#...#-#...#-#...#-.###.","I:#####-..#..-..#..-..#..-#####","L:#....-#....-#....-#....-#####","A:..#..-.#.#.-#####-#...#-#...#"}
Returns: { "#####.#####.####..#...#.#####.#.......#..", "..#...#.....#..#..#...#...#...#......#.#.", "..#...####..#..#..#...#...#...#.....#####", "..#...#.....#..#..#...#...#...#.....#...#", "..#...#####.#####..###..#####.#####.#...#" }
"XXXXXXXXX"
{ "X:#####-#####-#####-#####-#####" }
Returns: { "#####.#####.#####.#####.#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####.#####.#####.#####.#####" }
"TOPCODER"
{ "T:#####-..#..-..#..-..#..-..#..", "O:#####-#...#-#...#-#...#-#####", "P:####.-#...#-####.-#....-#....", "C:.####-#....-#....-#....-.####", "D:####.-#...#-#...#-#...#-####.", "E:#####-#....-####.-#....-#####", "R:####.-#...#-####.-#.#..-#..##" }
Returns: { "#####.#####.####...####.#####.####..#####.####.", "..#...#...#.#...#.#.....#...#.#...#.#.....#...#", "..#...#...#.####..#.....#...#.#...#.####..####.", "..#...#...#.#.....#.....#...#.#...#.#.....#.#..", "..#...#####.#......####.#####.####..#####.#..##" }
"DOK"
{ "D:####.-#...#-#...#-#...#-####.", "O:#####-#...#-#...#-#...#-#####", "K:#...#-#..#.-###..-#..#.-#...#" }
Returns: { "####..#####.#...#", "#...#.#...#.#..#.", "#...#.#...#.###..", "#...#.#...#.#..#.", "####..#####.#...#" }
"MYMY"
{ "M:#####-#####-#####-#####-#####", "Y:#####-#####-#####-#####-#####" }
Returns: { "#####.#####.#####.#####", "#####.#####.#####.#####", "#####.#####.#####.#####", "#####.#####.#####.#####", "#####.#####.#####.#####" }
"RANDOMNESS"
{ "S:##.##-#####-#.#.#-#.#.#-####.", "N:#####-#####-#####-#####-#####", "R:#####-#####-##.##-#####-#####", "A:.....-.....-.....-.....-.....", "D:#.#.#-.#.#.-#.#.#-.#.#.-#.#.#", "O:#####-#...#-#.#.#-#...#-#####", "E:#....-.#...-..#..-...#.-....#", "M:#....-.....-.....-.....-.....", "X:#...#-.#.#.-..#..-.#.#.-#...#" }
Returns: { "#####.......#####.#.#.#.#####.#.....#####.#.....##.##.##.##", "#####.......#####..#.#..#...#.......#####..#....#####.#####", "##.##.......#####.#.#.#.#.#.#.......#####...#...#.#.#.#.#.#", "#####.......#####..#.#..#...#.......#####....#..#.#.#.#.#.#", "#####.......#####.#.#.#.#####.......#####.....#.####..####." }
"AAA"
{ "A:#####-..#..-..#..-..#..-..#.." }
Returns: { "#####.#####.#####", "..#.....#.....#..", "..#.....#.....#..", "..#.....#.....#..", "..#.....#.....#.." }
"T"
{ "T:#####-..#..-..#..-..#..-..#.." }
Returns: { "#####", "..#..", "..#..", "..#..", "..#.." }
"AAAAA"
{ "A:#####-#####-#####-#####-#####" }
Returns: { "#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####" }
"PPCCCPCPC"
{ "P:####.-#...#-####.-#....-#....", "C:.####-#....-#....-#....-.####" }
Returns: { "####..####...####..####..####.####...####.####...####", "#...#.#...#.#.....#.....#.....#...#.#.....#...#.#....", "####..####..#.....#.....#.....####..#.....####..#....", "#.....#.....#.....#.....#.....#.....#.....#.....#....", "#.....#......####..####..####.#......####.#......####" }
"ABC"
{ "A:#####-#####-#####-#####-#####", "B:.....-.....-.....-.....-.....", "C:#####-.....-#####-.....-#####" }
Returns: { "#####.......#####", "#####............", "#####.......#####", "#####............", "#####.......#####" }