Leetcode 1894. Find the Student that Will Replace the Chalk
Given an array of chalk usage per student cycled repeatedly and k chalk pieces, find the index of the first student whose required chalk is strictly greater than the remaining pieces at their turn. Key insight: subtract full rounds by k %= sum(chalk), then find the first prefix sum > k (via linear scan or binary search on prefix sums).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.