Distribute N candies to K children by giving 1 candy to the first child, 2 to the second, ..., K to the K-th child, then K+1 to the first, and so on, until there are not enough candies left to give…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.