假设
a="abcdef"
b="defabc"
我尝试过,但还没有找到解决这个问题的方法。 如果有人做过,请告诉我答案。
尝试使用 a.sort()==b.sort() sort() 函数将对字符进行排序,然后 == 将比较字符串。