Statistics

Problem Statement for "Billboard"

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 String[] with each element formatted as follows (quotes added for clarity):

"<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 String[], with each element representing one row of lightbulbs (where element 0 is the top row). Leave 1 (one) column of periods ('.') between each adjacent pair of letters in the enlarged message.

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

  1. "TOPCODER"

    {"T:#####-..#..-..#..-..#..-..#.." ,"O:#####-#...#-#...#-#...#-#####" ,"P:####.-#...#-####.-#....-#...." ,"C:.####-#....-#....-#....-.####" ,"D:####.-#...#-#...#-#...#-####." ,"E:#####-#....-####.-#....-#####" ,"R:####.-#...#-####.-#.#..-#..##"}

    Returns: { "#####.#####.####...####.#####.####..#####.####.", "..#...#...#.#...#.#.....#...#.#...#.#.....#...#", "..#...#...#.####..#.....#...#.#...#.####..####.", "..#...#...#.#.....#.....#...#.#...#.#.....#.#..", "..#...#####.#......####.#####.####..#####.#..##" }

  2. "DOK"

    {"D:####.-#...#-#...#-#...#-####." ,"O:#####-#...#-#...#-#...#-#####" ,"K:#...#-#..#.-###..-#..#.-#...#"}

    Returns: { "####..#####.#...#", "#...#.#...#.#..#.", "#...#.#...#.###..", "#...#.#...#.#..#.", "####..#####.#...#" }

  3. "RANDOMNESS"

    {"S:##.##-#####-#.#.#-#.#.#-####." ,"N:#####-#####-#####-#####-#####" ,"R:#####-#####-##.##-#####-#####" ,"A:.....-.....-.....-.....-....." ,"D:#.#.#-.#.#.-#.#.#-.#.#.-#.#.#" ,"O:#####-#...#-#.#.#-#...#-#####" ,"E:#....-.#...-..#..-...#.-....#" ,"M:#....-.....-.....-.....-....." ,"X:#...#-.#.#.-..#..-.#.#.-#...#"}

    Returns: { "#####.......#####.#.#.#.#####.#.....#####.#.....##.##.##.##", "#####.......#####..#.#..#...#.......#####..#....#####.#####", "##.##.......#####.#.#.#.#.#.#.......#####...#...#.#.#.#.#.#", "#####.......#####..#.#..#...#.......#####....#..#.#.#.#.#.#", "#####.......#####.#.#.#.#####.......#####.....#.####..####." }

    Note that the letter X is defined but never used.

  4. "ABCDE"

    {"A:..#..-.#.#.-#####-#...#-#...#","B:####.-#...#-####.-#...#-####.","C:#####-#....-#....-#....-#####","D:####.-#...#-#...#-#...#-####.","E:#####-#....-####.-#....-#####"}

    Returns: { "..#...####..#####.####..#####", ".#.#..#...#.#.....#...#.#....", "#####.####..#.....#...#.####.", "#...#.#...#.#.....#...#.#....", "#...#.####..#####.####..#####" }

  5. "SKINNY"

    {"S:..##.-.#...-..#..-...#.-.##..","K:.#.#.-.##..-.#...-.##..-.#.#.","I:.###.-..#..-..#..-..#..-.###.","N:.#.#.-.###.-.###.-.###.-.#.#.","Y:.#.#.-.#.#.-..#..-..#..-..#.."}

    Returns: { "..##...#.#...###...#.#...#.#...#.#.", ".#.....##.....#....###...###...#.#.", "..#....#......#....###...###....#..", "...#...##.....#....###...###....#..", ".##....#.#...###...#.#...#.#....#.." }

  6. "ODED"

    {"O:#####-#...#-#...#-#...#-#####","D:####.-#...#-#...#-#...#-####.","E:#####-#....-####.-#....-#####"}

    Returns: { "#####.####..#####.####.", "#...#.#...#.#.....#...#", "#...#.#...#.####..#...#", "#...#.#...#.#.....#...#", "#####.####..#####.####." }

  7. "LARS"

    {"L:#....-#....-#....-#....-#####","A:..#..-.#.#.-#####-#...#-#...#","R:####.-#...#-####.-#..#.-#...#","S:..##.-.#...-..#..-...#.-.##.."}

    Returns: { "#.......#...####....##.", "#......#.#..#...#..#...", "#.....#####.####....#..", "#.....#...#.#..#.....#.", "#####.#...#.#...#..##.." }

  8. "ABBA"

    {"A:####.-#...#-####.-#...#-####.","B:..#..-.#.#.-#####-#...#-#...#"}

    Returns: { "####....#.....#...####.", "#...#..#.#...#.#..#...#", "####..#####.#####.####.", "#...#.#...#.#...#.#...#", "####..#...#.#...#.####." }

  9. "TRIANGLE"

    {"T:.....-..#..-.#.#.-#####-.....","R:.....-..#..-.#.#.-#####-.....","I:.....-..#..-.#.#.-#####-.....","A:.....-..#..-.#.#.-#####-.....","N:.....-..#..-.#.#.-#####-.....","G:.....-..#..-.#.#.-#####-.....","L:.....-..#..-.#.#.-#####-.....","E:.....-..#..-.#.#.-#####-....."}

    Returns: { "...............................................", "..#.....#.....#.....#.....#.....#.....#.....#..", ".#.#...#.#...#.#...#.#...#.#...#.#...#.#...#.#.", "#####.#####.#####.#####.#####.#####.#####.#####", "..............................................." }

  10. "XXXXXXXX"

    {"X:#...#-.#.#.-..#..-.#.#.-#...#","Y:###.#-#.#.#-..###-#####-....#"}

    Returns: { "#...#.#...#.#...#.#...#.#...#.#...#.#...#.#...#", ".#.#...#.#...#.#...#.#...#.#...#.#...#.#...#.#.", "..#.....#.....#.....#.....#.....#.....#.....#..", ".#.#...#.#...#.#...#.#...#.#...#.#...#.#...#.#.", "#...#.#...#.#...#.#...#.#...#.#...#.#...#.#...#" }

  11. "NSF"

    {"N:#...#-##..#-#.#.#-#..##-#...#","S:.###.-#....-####.-#...#-.###.","F:..#..-.##..-#####-..#..-..#.."}

    Returns: { "#...#..###....#..", "##..#.#......##..", "#.#.#.####..#####", "#..##.#...#...#..", "#...#..###....#.." }

  12. "PST"

    {"P:####.-#...#-####.-#....-#....","S:.####-#....-.###.-....#-####.","T:.###.-#...#-..##.-.#...-#####"}

    Returns: { "####...####..###.", "#...#.#.....#...#", "####...###....##.", "#.........#..#...", "#.....####..#####" }

  13. "XBOX"

    {"X:#...#-.#.#.-..#..-.#.#.-#...#","B:####.-#...#-####.-#...#-####.","O:.###.-#...#-#...#-#...#-.###."}

    Returns: { "#...#.####...###..#...#", ".#.#..#...#.#...#..#.#.", "..#...####..#...#...#..", ".#.#..#...#.#...#..#.#.", "#...#.####...###..#...#" }

  14. "SNES"

    {"S:.####-#....-.###.-....#-####.","N:#...#-##..#-#.#.#-#..##-#...#","E:#####-#....-####.-#....-#####"}

    Returns: { ".####.#...#.#####..####", "#.....##..#.#.....#....", ".###..#.#.#.####...###.", "....#.#..##.#.........#", "####..#...#.#####.####." }

  15. "TEQUILA"

    {"T:#####-..#..-..#..-..#..-..#..","E:#####-#....-####.-#....-#####","Q:####.-#..#.-#..#.-#..#.-#####","U:#...#-#...#-#...#-#...#-.###.","I:#####-..#..-..#..-..#..-#####","L:#....-#....-#....-#....-#####","A:..#..-.#.#.-#####-#...#-#...#"}

    Returns: { "#####.#####.####..#...#.#####.#.......#..", "..#...#.....#..#..#...#...#...#......#.#.", "..#...####..#..#..#...#...#...#.....#####", "..#...#.....#..#..#...#...#...#.....#...#", "..#...#####.#####..###..#####.#####.#...#" }

  16. "XXXXXXXXX"

    { "X:#####-#####-#####-#####-#####" }

    Returns: { "#####.#####.#####.#####.#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####.#####.#####.#####.#####" }

  17. "TOPCODER"

    { "T:#####-..#..-..#..-..#..-..#..", "O:#####-#...#-#...#-#...#-#####", "P:####.-#...#-####.-#....-#....", "C:.####-#....-#....-#....-.####", "D:####.-#...#-#...#-#...#-####.", "E:#####-#....-####.-#....-#####", "R:####.-#...#-####.-#.#..-#..##" }

    Returns: { "#####.#####.####...####.#####.####..#####.####.", "..#...#...#.#...#.#.....#...#.#...#.#.....#...#", "..#...#...#.####..#.....#...#.#...#.####..####.", "..#...#...#.#.....#.....#...#.#...#.#.....#.#..", "..#...#####.#......####.#####.####..#####.#..##" }

  18. "DOK"

    { "D:####.-#...#-#...#-#...#-####.", "O:#####-#...#-#...#-#...#-#####", "K:#...#-#..#.-###..-#..#.-#...#" }

    Returns: { "####..#####.#...#", "#...#.#...#.#..#.", "#...#.#...#.###..", "#...#.#...#.#..#.", "####..#####.#...#" }

  19. "MYMY"

    { "M:#####-#####-#####-#####-#####", "Y:#####-#####-#####-#####-#####" }

    Returns: { "#####.#####.#####.#####", "#####.#####.#####.#####", "#####.#####.#####.#####", "#####.#####.#####.#####", "#####.#####.#####.#####" }

  20. "RANDOMNESS"

    { "S:##.##-#####-#.#.#-#.#.#-####.", "N:#####-#####-#####-#####-#####", "R:#####-#####-##.##-#####-#####", "A:.....-.....-.....-.....-.....", "D:#.#.#-.#.#.-#.#.#-.#.#.-#.#.#", "O:#####-#...#-#.#.#-#...#-#####", "E:#....-.#...-..#..-...#.-....#", "M:#....-.....-.....-.....-.....", "X:#...#-.#.#.-..#..-.#.#.-#...#" }

    Returns: { "#####.......#####.#.#.#.#####.#.....#####.#.....##.##.##.##", "#####.......#####..#.#..#...#.......#####..#....#####.#####", "##.##.......#####.#.#.#.#.#.#.......#####...#...#.#.#.#.#.#", "#####.......#####..#.#..#...#.......#####....#..#.#.#.#.#.#", "#####.......#####.#.#.#.#####.......#####.....#.####..####." }

  21. "AAA"

    { "A:#####-..#..-..#..-..#..-..#.." }

    Returns: { "#####.#####.#####", "..#.....#.....#..", "..#.....#.....#..", "..#.....#.....#..", "..#.....#.....#.." }

  22. "T"

    { "T:#####-..#..-..#..-..#..-..#.." }

    Returns: { "#####", "..#..", "..#..", "..#..", "..#.." }

  23. "AAAAA"

    { "A:#####-#####-#####-#####-#####" }

    Returns: { "#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####", "#####.#####.#####.#####.#####" }

  24. "PPCCCPCPC"

    { "P:####.-#...#-####.-#....-#....", "C:.####-#....-#....-#....-.####" }

    Returns: { "####..####...####..####..####.####...####.####...####", "#...#.#...#.#.....#.....#.....#...#.#.....#...#.#....", "####..####..#.....#.....#.....####..#.....####..#....", "#.....#.....#.....#.....#.....#.....#.....#.....#....", "#.....#......####..####..####.#......####.#......####" }

  25. "ABC"

    { "A:#####-#####-#####-#####-#####", "B:.....-.....-.....-.....-.....", "C:#####-.....-#####-.....-#####" }

    Returns: { "#####.......#####", "#####............", "#####.......#####", "#####............", "#####.......#####" }


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: