shlogg · Early preview
Md Ariful Haque @mah-shamim

Find Student Who Will Replace Chalk In Array

Find student who will replace chalk by simulating turns and iterating through array until remaining chalk is insufficient.

1894. Find the Student that Will Replace the Chalk
Difficulty: Medium
Topics: Array, Binary Search, Simulation, Prefix Sum
There are n students in a class numbered from 0 to n - 1. The teacher will give each student a problem starting with the student number 0, then the student number 1, and so on until the teacher reaches the student number n - 1. After that, the teacher will restart the process, starting with the student number 0 again.
You are given a 0-indexed integer array chalk and an integer k. There are initially k pieces of chalk. When the student number i is given a problem to solve,...