mrsac7 / CSES-Solutions

Accepted solutions of CSES problemset
https://cses.fi/problemset
340 stars 157 forks source link

Josephus Problem 1 working #7

Open AyushKoul00 opened 2 years ago

AyushKoul00 commented 2 years ago

I saw that you had a really good solution to the CSES problem Josephus Problem 1 but I was unable to understand how and why it works. Can you elaborate on its working or provide a resource that explains it? Everywhere I looked only has solutions using extra memory or some other complicated method.

Also, what is the time complexity of your solution? Finally, how can we generalize the solution to any value of k?

Khemendra-Bhardwaj commented 1 year ago

I saw that you had a really good solution to the CSES problem Josephus Problem 1 but I was unable to understand how and why it works. Can you elaborate on its working or provide a resource that explains it? Everywhere I looked only has solutions using extra memory or some other complicated method.

Also, what is the time complexity of your solution? Finally, how can we generalize the solution to any value of k?

did u able to find it out ?