Participants are navigating through a park with n checkpoints to reach the final destination. Each checkpoint represents a step, and participants have the flexibility to choose the number of steps they want to skip, representing their preferences or strategies in the game.
Each participant can skip a maximum of 2 steps at a time.
Return the total number of unique ways participants can reach the final checkpoint.
const scavengerHunt = (n) => {
// Enter your logic here...
}
Examples:
Input: n = 5
Output: 8
Explanation: There are 8 unique ways to reach the final destination.
Input: n = 2
Output: 2
Explanation: There are 2 unique ways to reach the final destination.