Problem Brief
Find Last Kid
OA
Given n number of kids, t toys and random number d from where the distribution will start. find the last kid who will get the toy. assume kids are sitting in ascending order and in circular way.
Input:
N- The number of kidsT- The number of toysD- Random number from where distribution should start
1Example 1
Input
N = 5, T = 2, D = 1
Output
2
Explanation
As we will start from 1 and kid getting last toy is 2.