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 :) )
std::string larrysArray(std::vector<int> const & _nums){ using namespace std; auto count = 0; for(auto it1 = begin(_nums); it1 != end(_nums) - 1; ++it1){ for(auto it2 = it1 + 1; it2 != end(_nums); ++it2){ if(*it1 > *it2){ count ^= 1; } } } return count == 0 ? "YES" : "NO"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Larry's Array
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 :) )