Starlight Lantern Chain
Each evening on Lyris Bluff, keepers line the cliffside with silver lanterns. The ceremony starts with a single lantern. A herald then announces the number of Tiers to follow. Each new tier adds a fresh guiding lantern, while wind-polished mirrors reflect every lantern from the previous tier twice over. In Starlight Lantern Chain, your task is to find the total lanterns visible when the ceremony concludes.
The "secret sauce" here is Recursive Doubling. For each tier i, the total count is calculated as: 1 + (2 * total_from_tier_i-1). If tiers is zero, only the initial lantern is visible (result: 1). This pattern creates two rivers of light that cast twin reflections down the stone. By the time the final tier is secured, the count has grown in a predictable, stable sequence of tiered light. Return the total count as a single integer, ensuring the sailors offshore can rely on the radiance to guide them home safely! Following this ritual literally reveals the beautiful geometry hidden in the glow.
Examples
The second tier adds a lantern and doubles the earlier glow.
Only the initial lantern shines.
Three tiers preserve the pattern, revealing fifteen lanterns in total.
Algorithm Flow

Best Answers
class Solution {
public int find_longest_increasing_chain(int[] nums) {
if (nums.length == 0) return 0;
int maxLen = 1, current = 1;
for (int i = 1; i < nums.length; i++) {
if (nums[i] > nums[i-1]) current++;
else current = 1;
maxLen = Math.max(maxLen, current);
}
return maxLen;
}
}Comments (0)
Join the Discussion
Share your thoughts, ask questions, or help others with this problem.
