In this question, it would be about identifying a pattern. If you start small, you will find this pattern:
When N is a power of 2, the number of the leader that gets selected is 1 and after that it moves in a sequence of odd numbers till the next power hits.
Once you get the sequence, you would be able to solve the question.
We need to find for N = 18.
Nearest power of 2 is 16, for which the number of leader would be 1.
Every subsequent jump of 1 in N will result in a jump of 2 in number of leader.
Jumps in N = 18 - 16 = 2
Jump in number of Leader = 2 x 2 = 4
So, the number of leader who will get selected is 1 + 4 = 5.
After 3 rounds 5 and 13 will remain, beginning with 5, 13 will have to step down.
Thus, 5 will be the leader.