Skip to content

Commit

Permalink
solve: valid anagram
Browse files Browse the repository at this point in the history
  • Loading branch information
wogha95 committed Aug 18, 2024
1 parent bdf08b0 commit 7c5c3cf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions valid-anagram/wogha95.js
Original file line number Diff line number Diff line change
@@ -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('');
};

0 comments on commit 7c5c3cf

Please sign in to comment.