BudiBadu Logo
00:00

Ember Glyph Mosaic

Recursion Medium 0 views

In the Emberglass Sanctum, artists craft mosaics that respond to a chant. The process begins with a core glyph grid—an array of rows describing patterns of symbols such as [".o.", "ooo"]. Each ring of assistants adds a new glyph band, stamped with a legend code like "North Gate" or "Amber Crest". The sanctum requires an exact recursive pattern to ensure the ember dust fuses the layers properly.

To add a new band named marker, the assistants first place a border row "{marker}^" above the current mosaic, then append the existing mosaic row by row, next insert a mirrored row "v{marker}" to anchor the return cadence, and finally append the mosaic again row by row. This sequence doubles the grid vertically while tracking which band is currently active. When no more bands remain, the mosaic consists only of the base rows.

You receive a base list of strings representing the initial glyph rows, and a bands list of names ordered from the closest band to the farthest. Produce the full list of strings after all bands are applied. Do not mutate the input. Each marker contributes exactly two new rows and two copies of the inner grid in the order described.

Example 1:

Input: base = ["*"], bands = []
Output: ["*"]

Example 2:

Input: base = ["*"], bands = ["North"]
Output: ["North^", "*", "vNorth", "*"]

Example 3:

Input: base = [".o.", "ooo"], bands = ["Amber", "Quartz"]
Output: ["Amber^", "Quartz^", ".o.", "ooo", "vQuartz", ".o.", "ooo", "Amber^", "Quartz^", ".o.", "ooo", "vQuartz", ".o.", "ooo", "vAmber", "Quartz^", ".o.", "ooo", "vQuartz", ".o.", "ooo"]

Related Problems

No related problems found

Comments (0)

Join the Discussion

Share your thoughts, ask questions, or help others with this problem.

BudiBadu Logo

Ember Glyph Mosaic

Recursion Medium 0 views

In the Emberglass Sanctum, artists craft mosaics that respond to a chant. The process begins with a core glyph grid—an array of rows describing patterns of symbols such as [".o.", "ooo"]. Each ring of assistants adds a new glyph band, stamped with a legend code like "North Gate" or "Amber Crest". The sanctum requires an exact recursive pattern to ensure the ember dust fuses the layers properly.

To add a new band named marker, the assistants first place a border row "{marker}^" above the current mosaic, then append the existing mosaic row by row, next insert a mirrored row "v{marker}" to anchor the return cadence, and finally append the mosaic again row by row. This sequence doubles the grid vertically while tracking which band is currently active. When no more bands remain, the mosaic consists only of the base rows.

You receive a base list of strings representing the initial glyph rows, and a bands list of names ordered from the closest band to the farthest. Produce the full list of strings after all bands are applied. Do not mutate the input. Each marker contributes exactly two new rows and two copies of the inner grid in the order described.

Example 1:

Input: base = ["*"], bands = []
Output: ["*"]

Example 2:

Input: base = ["*"], bands = ["North"]
Output: ["North^", "*", "vNorth", "*"]

Example 3:

Input: base = [".o.", "ooo"], bands = ["Amber", "Quartz"]
Output: ["Amber^", "Quartz^", ".o.", "ooo", "vQuartz", ".o.", "ooo", "Amber^", "Quartz^", ".o.", "ooo", "vQuartz", ".o.", "ooo", "vAmber", "Quartz^", ".o.", "ooo", "vQuartz", ".o.", "ooo"]

00:00
Loading editor...
Test Results

Run your code to see test results

Click the Submit button to execute your solution

Related Problems

No related problems found

Comments (0)

Join the Discussion

Share your thoughts, ask questions, or help others with this problem.