You are viewing a single comment's thread. Return to all comments →
C++ (more at https://github.com/IhorVodko/Hackerrank_solutions/tree/master , feel free to give a star :) )
std::string nimGame(std::vector<int> const & _piles){ auto binSum = 0; for(auto const & size : _piles){ binSum ^= size; } return binSum ? "First" : "Second"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Introduction to Nim Game
You are viewing a single comment's thread. Return to all comments →
C++ (more at https://github.com/IhorVodko/Hackerrank_solutions/tree/master , feel free to give a star :) )