idkhandle's blog

By idkhandle, history, 6 weeks ago, In English

Recently I came across a question in which we need to solve the problem mentioned here: https://leetcode.com/problems/exam-room/

Such that we are given N and K ( N is total number of seats in exam hall and Kth person enters). There is no leave operation, but only a seat operation is there.

Is there any way I could know where the Kth person would sit? ( assuming no one leaves )

Constraints

1<=N<=1e18

K<=N

 
 
 
 
  • Vote: I like it
  • -15
  • Vote: I do not like it

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Anyone?

»
6 weeks ago, # |
  Vote: I like it -8 Vote: I do not like it

Bump. Anyone ?