Created
January 11, 2021 09:58
-
-
Save pitsanujiw/ed415a2272c69086d2bba175f7084880 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isAnagram(s, t) { | |
let ss =s.split('').sort(); | |
let tt = t.split('').sort(); | |
if (s.length != t.length) return false; | |
for (let i = 0; i < s.length; i++) { | |
if (ss[i] != tt[i]) { | |
return false; | |
} | |
} | |
return true; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment