Josephus Problem
Medium
Recursion Fundamentals
n people stand in a circle and every k-th person is removed until one remains. Print the position (1-indexed) of the survivor.
Constraints
1 <= n <= 10^6 1 <= k <= 10^6
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.