Canyon Echo Verse
Deep within the stone walls of Crescent Canyon, a traditional chant creates a massive layering of echoes. Your mission in Canyon Echo Verse is to calculate the total number of lines echoing in the amphitheater after a specific sequence of layered vocal performances. The chant begins with a single line, and each subsequent layer adds a new verse while the walls replicate the entire previous chorus twice—once from each side!
The "secret sauce" here is a Squared Geometric Progression. The total count of verses follows the formula f(n) = (2ⁿ⁺¹ - 1)², where n is the number of echo layers. This pattern emerges because the ritual doubles both the length and width of the vocal presence simultaneously. Calculating this precise integer count is vital for storytellers who need to maintain the exact cadence required by Crescent Canyon tradition.
This challenge is a brilliant way to practice modeling 2D growth patterns with simple math. It’s a step up from linear growth, showing how quickly a soundscape can become massive and complex!
Examples
Only the narrator speaks, so one verse is heard.
The second layer adds a verse and repeats the earlier chorus twice.
Four layers continue the same pattern, leading to forty-nine verses echoing through the canyon.
Algorithm Flow

Best Answers
class Solution {
public int count_echo_verses(int layers) {
int base = (1 << (layers + 1)) - 1;
return base * base;
}
}Comments (0)
Join the Discussion
Share your thoughts, ask questions, or help others with this problem.
