The conversation between human and AI assistant.
How do I improve solution for Josephus problem algorithm?
I've used a circular linked list to simulate the problem, but it still takes too long for large inputs.
Have you tried using recursion?