K = 2 is a special case for Josephus problem
InterviewBit Problems
100 People in a Circle : Solved
kaushal_sahu
2019-06-10 10:27:17 UTC
#1
n is even so it can be calculated by
2n - 2
floor(log
2
n)
+ 1
forumla.