题解 | #确定两串乱序同构#
确定两串乱序同构
https://www.nowcoder.com/practice/164929d4acd04de5b0ee2d93047b3b20
#include <algorithm>
#include <string>
class Same {
public:
bool checkSam(string stringA, string stringB) {
// write code here
sort(stringA.begin(), stringA.end());
sort(stringB.begin(), stringB.end());
if(stringA == stringB){
return true;
}
return false;
}
};
先将string进行排序(以ASCII值),然后直接相比较就行了

