Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.11 KB | None | 0 0
  1. class Solution {
  2. public:
  3. int lastRemaining(int n) {
  4. return n==1?1:2*(1+n/2-lastRemaining(n/2));
  5. }
  6. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement