Ember Glyph Mosaic
Artists in the Emberglass Sanctum craft mosaics that respond to ritual chants. Each mosaic begins with a Base grid of glyph rows. Assistants then add a series of Bands like "Amber Crest" or "North Gate". Your mission in Ember Glyph Mosaic is to generate the full list of strings after all bands have been recursively applied by the team.
The "secret sauce" here is Recursive Symmetrical Expansion. Each band named marker wraps the current grid: first add a border "{marker}^" above, then append the full current grid, next add a mirrored row "v{marker}", and finally append the grid again. This doubles the layout vertically for every band added. If bands is empty, return just the base rows. The result is a woven experience that ensures the ember dust fuses perfectly across every layer! You must return the final array of strings in the precise order guests will see them throughout the sanctuary ceremony.
For text and token tasks, be precise with index movement and substring boundaries. Most hidden failures come from partial-match handling and boundary cuts, so keep comparisons explicit and avoid assumptions about implicit separators or formatting not guaranteed by the input contract.
Examples
Example with input: base = ["*"], bands = ["North"]
Example with input: base = ["*"], bands = []
Example with input: base = [".o.", "ooo"], bands = ["Amber", "Quartz"]
Algorithm Flow

Best Answers
import java.util.*;
class Solution {
public String[] ember_glyph_mosaic(String[] base, String[] bands) {
return build(Arrays.asList(base), bands, 0).toArray(new String[0]);
}
private List<String> build(List<String> current, String[] bands, int idx) {
if (idx >= bands.length) return new ArrayList<>(current);
String marker = bands[idx];
List<String> inner = build(current, bands, idx + 1);
List<String> result = new ArrayList<>();
result.add(marker + "^");
result.addAll(inner);
result.add("v" + marker);
result.addAll(inner);
return result;
}
}Comments (0)
Join the Discussion
Share your thoughts, ask questions, or help others with this problem.
