标签:style blog color os io ar for div log
#include <iostream> #include <string> #include <algorithm> using namespace std; bool StringIsUnique(string s) { sort(s.begin(),s.end()); for (auto p = s.begin(); p != s.end()-1;) { if (*p == *++p) return false; } return true; } int main(int argc, const char * argv[]) { string s = "akjnsdkjahrj"; cout << StringIsUnique(s) << endl; string s2 = "qwertyuiop"; cout << StringIsUnique(s2) << endl; return 0; }
Cracking the Coding Interview 1-1
标签:style blog color os io ar for div log
原文地址:http://www.cnblogs.com/vindicated/p/3947216.html