Question available in description👇👇 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Question available in description👇👇

Integer N represents the number of candies arranged in a circle,numbered from 0 to N−1. You will eat a candy and leave the wrapper. You shall begin eating with candy number 0. Then you omit the next M−1 candy or wrappers on the circle, and eat the following one. More precisely, if you ate candy number X, then you will next eat the candy with number(X +M) modulo N(remainderofdivision). You stop eating when you encounter an empty wrapper. For example, given integers N=10 and M=4. You will eat the following candy:0,4,8,2,6. Your answers should be 5 i.e. count the number of candy you ate..

28th Jun 2019, 1:47 AM
Shashi Gupta
Shashi Gupta - avatar
3 Answers
+ 5
Sorry, I can't see the question? It reads like instructions to a code challenge? Do you want someone to code this?
28th Jun 2019, 3:16 AM
jay
jay - avatar
+ 4
Where is the question?
28th Jun 2019, 2:35 AM
jay
jay - avatar
+ 4
Ques is in description
28th Jun 2019, 3:14 AM
Shashi Gupta
Shashi Gupta - avatar