TopCoder High School SRM 40 Level one - 250 pt - Secretary editorial: http://community.topcoder.com/tc?module=Static&d1=hs&d2=match_editorials&d3=hs_srm40
TopCoder High School SRM 40 Level one - 250 pt - Secretary solution:
#include <iostream> #include <vector> #include <algorithm> using namespace std; class Secretary { public: string wrongOrdering(vector <string> f) { string s; for(int i=0; i<f.size(); i++) reverse(f[i].begin(), f[i].end()); sort(f.begin(), f.end()); reverse(f[0].begin(), f[0].end()); s=f[0]; return s; } };
No comments:
Post a Comment