BudiBadu Logo
00:00

Aurora Feather Lights

Recursion Easy 0 views

High above Borealis Strait, skyward couriers maintain a tradition called the Aurora Feather Flight. Each night they launch a ribbon of gliders, each bearing a glowing feather lantern. The first feather rises alone, tracing a pale arc that helps traveling caravans locate the safe valley corridor. Before more gliders lift off, the lead courier announces how many sweep layers will colour the air. For each additional sweep, the team secures one fresh feather at the front of the ribbon, and the gliders from the previous sweep arc back in four mirrored paths, painting the sky with cascading streaks of luminescence.

The pilots insist on repeating the pattern without deviation, because the mining towns below rely on the steady rhythm to time their convoys. Once the guiding feather gleams, every glow from the former sweep wheels around fourfold, and lookout towers count the passes to ensure the corridor remains clear. There is no improvisation; generations of night flights have proven that the rule of one new feather plus four echoes keeps the sky lanes orderly even when winds buffet the peaks.

Your task is to report how many illuminated feathers observers witness when the final sweep finishes its arc. The input is a non-negative integer named sweeps. When sweeps equals zero, only the lone opening feather is visible. For each higher value, add a guiding feather and include four copies of the full display from the previous sweep. Return the total feathers as an integer once the aurora flight concludes.

Example 1:

Input: sweeps = 0
Output: 1
Explanation: Only the opening feather lantern glows.

Example 2:

Input: sweeps = 2
Output: 21
Explanation: The second sweep adds one feather and echoes the earlier light four times.

Example 3:

Input: sweeps = 4
Output: 341
Explanation: Four sweeps follow the rule, producing three hundred forty-one shimmering feathers.

Related Problems

No related problems found

Comments (0)

Join the Discussion

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

BudiBadu Logo

Aurora Feather Lights

Recursion Easy 0 views

High above Borealis Strait, skyward couriers maintain a tradition called the Aurora Feather Flight. Each night they launch a ribbon of gliders, each bearing a glowing feather lantern. The first feather rises alone, tracing a pale arc that helps traveling caravans locate the safe valley corridor. Before more gliders lift off, the lead courier announces how many sweep layers will colour the air. For each additional sweep, the team secures one fresh feather at the front of the ribbon, and the gliders from the previous sweep arc back in four mirrored paths, painting the sky with cascading streaks of luminescence.

The pilots insist on repeating the pattern without deviation, because the mining towns below rely on the steady rhythm to time their convoys. Once the guiding feather gleams, every glow from the former sweep wheels around fourfold, and lookout towers count the passes to ensure the corridor remains clear. There is no improvisation; generations of night flights have proven that the rule of one new feather plus four echoes keeps the sky lanes orderly even when winds buffet the peaks.

Your task is to report how many illuminated feathers observers witness when the final sweep finishes its arc. The input is a non-negative integer named sweeps. When sweeps equals zero, only the lone opening feather is visible. For each higher value, add a guiding feather and include four copies of the full display from the previous sweep. Return the total feathers as an integer once the aurora flight concludes.

Example 1:

Input: sweeps = 0
Output: 1
Explanation: Only the opening feather lantern glows.

Example 2:

Input: sweeps = 2
Output: 21
Explanation: The second sweep adds one feather and echoes the earlier light four times.

Example 3:

Input: sweeps = 4
Output: 341
Explanation: Four sweeps follow the rule, producing three hundred forty-one shimmering feathers.

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.