You are viewing a single comment's thread. Return to all comments →
bool cmp(string a, string b) { for(int i = 0; i < a.size(); i++) if(a[i] < b[i]) return true; return false; } string gridChallenge(vector<string> grid) { for(auto &s : grid) sort(s.begin(), s.end()); if(is_sorted(grid.begin(), grid.end(), cmp)) return "YES"; else return "NO"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Grid Challenge
You are viewing a single comment's thread. Return to all comments →