1894. Find the Student that Will Replace the Chalk
class Solution:
def chalkReplacer(self, chalk: List[int], k: int) -> int:
total = sum(chalk)
rem = k % total
i = 0
while rem >= 0:
rem -= chalk[i]
i += 1
return i - 1
tapanrachchh.hashnode.dev1 min read