We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4d9cca commit e065a0dCopy full SHA for e065a0d
valid-anagram/Lustellz.ts
@@ -1 +1,14 @@
1
// 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