You are given an integer candies representing the total number of candies available, and an integer num_people representing the number of people standing in a line.
The candies are distributed in rounds:
We give num_people candies to the last person.
Then, we return to the first person and give num_people num_people
This process continues until we run out of candies. If there are not enough candies remaining to satisfy the required amount for the current person, that person receives all the remaining candies, and the distribution ends.
Return an array of length num_people representing the total number of candies each person receives.
Constraints:
candies
num_people
You are given an integer candies representing the total number of candies available, and an integer num_people representing the number of people standing in a line.
The candies are distributed in rounds:
We give num_people candies to the last person.
Then, we return to the first person and give num_people num_people
This process continues until we run out of candies. If there are not enough candies remaining to satisfy the required amount for the current person, that person receives all the remaining candies, and the distribution ends.
Return an array of length num_people representing the total number of candies each person receives.
Constraints:
candies
num_people