You are viewing a single comment's thread. Return to all comments →
C++ (more at https://github.com/IhorVodko/Hackerrank_solutions , feel free to give a star :) )
long int sumXor(long int _num) { size_t satisfies = 0; while(_num){ satisfies += _num % 2 == 0 ? 1 : 0; _num /= 2; } return std::pow(2, satisfies); }
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 →
C++ (more at https://github.com/IhorVodko/Hackerrank_solutions , feel free to give a star :) )