Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3178. Find the Child Who Has the Ball After K Seconds
Children in a line pass a ball one step per second, reversing direction whenever it reaches either end; determine which child holds the ball after k seconds. Exploit the periodicity 2*(n-1) to reduce k and mirror (reflect) the position past the right end to get the final index.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.