Skip to content

Commit 76bc3aa

Browse files
authored
Create 242. Valid Anagram
1 parent 280957a commit 76bc3aa

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @param {string} s
3+
* @param {string} t
4+
* @return {boolean}
5+
*/
6+
var isAnagram = function(s, t) {
7+
const a = s.split("").sort().join("");
8+
const b = t.split("").sort().join("");
9+
10+
if (a == b) return true;
11+
else return false;
12+
};

0 commit comments

Comments
 (0)