Code Logo

Aurora Feather Lights

Published at05 Jan 2026
Array Manipulation Easy 6 views
Like14

You can think of this as a small game with a very specific goal. In Aurora Feather Lights, you are trying to work toward the right number by following one clear idea.

Calculate feather lantern sequence growth pattern A good way to think about it is to first understand what goes in, then what rule you must follow, and finally what shape the answer should have.

For example, if the input is sweeps = 4, the answer is 341. Four sweeps follow the rule, producing three hundred forty-one shimmering feathers. Another example is sweeps = 0, which gives 1. Only the opening feather lantern glows.

This is a friendly practice problem, but it still rewards careful reading. The key is understanding the rule clearly and then applying it carefully.

One helpful habit is to say the rule out loud in your own words before you start solving. If you can explain what counts, what changes, and what the final answer should look like, you are already much closer to the right solution.

Example Input & Output

Example 1
Input
sweeps = 4
Output
341
Explanation

Four sweeps follow the rule, producing three hundred forty-one shimmering feathers.

Example 2
Input
sweeps = 0
Output
1
Explanation

Only the opening feather lantern glows.

Example 3
Input
sweeps = 2
Output
21
Explanation

The second sweep adds one feather and echoes the earlier light four times.

Algorithm Flow

Recommendation Algorithm Flow for Aurora Feather Lights
Recommendation Algorithm Flow for Aurora Feather Lights

Best Answers

java
class Solution {
    public int aurora_feather_lights(int sweeps) {
        int total = 0;
        for (int i = 0; i <= sweeps; i++) {
            total += (int) Math.pow(4, i);
        }
        return total;
    }
}