diff --git a/valid-anagram/wogha95.js b/valid-anagram/wogha95.js new file mode 100644 index 000000000..90b723358 --- /dev/null +++ b/valid-anagram/wogha95.js @@ -0,0 +1,11 @@ +// TC: O(N * log N) +// SC: O(N) + +/** + * @param {string} s + * @param {string} t + * @return {boolean} + */ +var isAnagram = function(s, t) { + return s.split('').sort().join('') === t.split('').sort().join(''); +}; \ No newline at end of file