原题题目
代码实现(首刷自解)
class Solution {
public:bool judge(string& s1,string& s2){
int flag = 0;for(int i=0;i<s1.size();++i)if(s1[i] < s2[i]) return false;return true;}bool checkIfCanBreak(string s1, string s2) {
sort(s1.begin(),s1.end());sort(s2.begin(),s2.end());return judge(s1,s2) || judge(s2,s1);}
};