Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- int lastRemaining(int n) {
- return n==1?1:2*(1+n/2-lastRemaining(n/2));
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement