You are viewing a single comment's thread. Return to all comments →
O(1)
public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); long t = in.nextLong(); long x = (t + 2) / 3; long b = Long.highestOneBit(x); long tb = 3 * b; System.out.println(tb - (t - (tb - 2))); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Strange Counter
You are viewing a single comment's thread. Return to all comments →
O(1)