VEDANTU | Off-Campus OA (2024) | Find the Student that Will Replace the Chalk Question
Question · Posted Jun 2026
Problem Statement There are n students standing in a circle. The i-th student uses chalk[i] pieces of chalk every time they solve a problem. The teacher starts with k pieces of chalk and repeatedly asks students to solve problems in order. When there isn't enough chalk left for the current student, that student must replace the chalk. Return the index of the student who will replace the chalk. Example Input chalk = [5,1,5] k = 22 Output 0 Explanation Total ...
The full answer & interview discussion are available to premium members.
Log in Create a free account