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.
/* * Complete the 'sumXor' function below. * * The function is expected to return a LONG_INTEGER. * The function accepts LONG_INTEGER n as parameter. */longsumXor(longn){longcount=0;autos=bitset<64>(n).to_string();autot=s.find_first_of("1");for(size_ti=t+1;i<64;++i){if(s[i]=='0'){count++;}}// cout << count << endl;return1L<<count;}
Cookie support is required to access HackerRank
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 →