There are chalk of length chalk[i] represents the number of pieces of chalk that student i consumes to solve a single problem. You are also given an integer k, representing the initial amount of chalk pieces.
The students take turns answering questions in order starting from student
During their turn, if the number of remaining chalk pieces is strictly less than chalk[i], student i must replace the chalk.
Return the index of the student who will replace the chalk.
Constraints:
chalk.length
chalk[i]
There are chalk of length chalk[i] represents the number of pieces of chalk that student i consumes to solve a single problem. You are also given an integer k, representing the initial amount of chalk pieces.
The students take turns answering questions in order starting from student
During their turn, if the number of remaining chalk pieces is strictly less than chalk[i], student i must replace the chalk.
Return the index of the student who will replace the chalk.
Constraints:
chalk.length
chalk[i]