My solution is a quick one liner- compare the sorted strings and return true if they're the same, false if they're not.
class Solution: # @return a boolean def isScramble(self, s1, s2): return ''.join(sorted(s1))==''.join(sorted(s2))
The result I get is:
179 / 281 test cases passed.
Status: Wrong Answer
Submitted: 1 minute ago
Input: "abcd", "bdac"
I don't see how "bdac" and "abcd" are different...?