Skip to content

Commit e065a0d

Browse files
authored
solution on valid-anagram
1 parent a4d9cca commit e065a0d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

valid-anagram/Lustellz.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
11
// week 2's goal
2+
// only focusing on not using for... not a good approach :(
3+
4+
function isAnagram(s: string, t: string): boolean {
5+
if(s.length !== t.length) return false
6+
let sArray : string[] = s.split('').sort()
7+
s = sArray.join('')
8+
let tArray : string[] = t.split('').sort()
9+
t = tArray.join('')
10+
if(s === t) return true
11+
else return false
12+
};
13+
14+
// reflection: not to be hurry & have more time for pondering

0 commit comments

Comments
 (0)