Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Subtract the sum of chalk from k until k is less than the sum of chalk.
Now iterate over the array. If chalk[i] is less than k, this is the answer. Otherwise, subtract chalk[i] from k and continue.