Problem Brief
π¦ Collect Sticks
FULLTIMEOA
You are given an array forest and the bird's starting position bird.
forest[i] represents the length of the stick at position i.
If forest[i] == 0, it means there is no stick at position i.
The bird's starting position bird will always be an index where there is no stick (forest[bird] == 0).
The bird follows this process:
You need to output the indices of the sticks that the bird picks up, in the order they are collected.
Note:
1Example 1
Input
forest = [0, 50, 0, 30, 0, 25], bird = 2
Output
[3, 1, 5]
Explanation
Pls ignore the explanation in the source image.
Constraints
Limits and guarantees your solution can rely on.
π¦