This continues the bitmap-font renderer. A font maps each character name to its glyph grid (a list of equal-length 0/1 rows). All glyphs in a font share the same height but may have different widths.
Render a word by joining the per-character glyphs side-by-side with no spacing between letters, producing one multi-row grid, then convert that grid to symbols (0 becomes ., 1 becomes #). Concatenate the binary rows of every glyph first, then convert. Return the rendered picture as a list of strings.
An empty text returns an empty list. The output height equals the height of the glyphs in the font.
Font encoding for this problem: font is a String[] where each entry is "name:row1|row2|...|rowH" — the character name, a colon, then the glyph's binary rows separated by |. For example, the glyph for H with rows 10001,10001,11111,10001,10001 is encoded as "H:10001|10001|11111|10001|10001".
text = "HI" font = ["H:10001|10001|11111|10001|10001", "I:111|010|010|010|111"] return = ["#...####", "#...#.#.", "#####.#.", "#...#.#.", "#...####"]
text = "" font = ["H:10001|10001|11111|10001|10001", "I:111|010|010|010|111"] return = []
- Every character in
texthas a glyph entry infont. - All glyphs in the font share one height; widths may differ.
- Concatenate glyph rows with no inter-letter spacing, then map
0to.and1to#. - An empty
textreturns[]. - Font entries are
"name:row1|row2|...".
- Account Balance Manager Part 3 - Platform CoverageONSITE INTERVIEW · Seen Jun 2026
- BitFont Part 3 - Decode Run-Length-Encoded RowsONSITE INTERVIEW · Seen Jun 2026
- Record Linkage Part 3 - Full Connected ComponentPHONE SCREEN · Seen Jun 2026
- Shipping Cost Calculator Part 3 - Mixed Fixed/Incremental TiersONSITE INTERVIEW · Seen Jun 2026
- Transaction Fee Calculator - Per-Merchant Volume DiscountPHONE SCREEN · Seen Jun 2026
- Account Balance Manager Part 2 - Reject OverdraftsONSITE INTERVIEW · Seen Jun 2026
- Factory Cost - Min-Cost Path Skipping One StagePHONE SCREEN · Seen Jun 2026
- HTTP Accept-Language with Quality Scores (q-factors)ONSITE INTERVIEW · Seen Jun 2026
public String[] renderWord(String text, String[] font) {
// write your code here
}