Count Duo Badge Plans
Preview mode. Log in to edit, run, submit, and save progress.
Medium
Count Duo Badge Plans
An event desk has n attendees waiting for the opening photo. Each attendee must either stand alone with a solo badge or join exactly one two-person badge group with another attendee. Every attendee must be included exactly once. Return the number of different badge plans modulo 10^9 + 7.
Examples
Example 1
Input:
n = 1
Output:
1
Explanation: The only attendee must stand alone.
Approach hint
Focus on what happens to the nth attendee.
Common mistake
Skipping assumptions, edge cases, or trade-offs can make an otherwise good answer feel incomplete.
solution.cpp