Skip to content

Commit 7c5c3cf

Browse files
committed
solve: valid anagram
1 parent bdf08b0 commit 7c5c3cf

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

valid-anagram/wogha95.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// TC: O(N * log N)
2+
// SC: O(N)
3+
4+
/**
5+
* @param {string} s
6+
* @param {string} t
7+
* @return {boolean}
8+
*/
9+
var isAnagram = function(s, t) {
10+
return s.split('').sort().join('') === t.split('').sort().join('');
11+
};

0 commit comments

Comments
 (0)