You are viewing a single comment's thread. Return to all comments →
My Below code is failing for some test case kindly help me where i did mistake.
public static void main(String[] args) {
Scanner in = new Scanner(System.in); long n = in.nextLong(); System.out.println(LongStream.range(0, n).filter(num -> ((n+num) == (n^num))).count()); }
Seems like cookies are disabled on this browser, please enable them to open this website
Sum vs XOR
You are viewing a single comment's thread. Return to all comments →
My Below code is failing for some test case kindly help me where i did mistake.
public static void main(String[] args) {