We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
the problem specification is poorly written:
only consider pairs for 1 -n and numbers greater than that:
ex 1,2 ; 1,3; 1,4
2,3; 2,4
3,4;
4&4 is 4, so if you consider the number to itself it will always be k-1;
if you use loops, one loop goes from 1 to n-1, the other from (index +1) to n.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Bitwise Operators
You are viewing a single comment's thread. Return to all comments →
the problem specification is poorly written: only consider pairs for 1 -n and numbers greater than that: ex 1,2 ; 1,3; 1,4 2,3; 2,4 3,4; 4&4 is 4, so if you consider the number to itself it will always be k-1; if you use loops, one loop goes from 1 to n-1, the other from (index +1) to n.