We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4b36703 + 2dc5601 commit b3be6acCopy full SHA for b3be6ac
Strings/isAnagram.js
@@ -0,0 +1,20 @@
1
+// Simple function that checks if two strings are anagrams. Returns true or false.
2
+
3
+function isAnagram(a,b){
4
+ if (a.length !== b.length){
5
+ return false;
6
+ }
7
+ var counter = 0;
8
+ for (var i=0; i<a.length; i++){
9
+ for (var j=0; j<b.length; j++){
10
+ if (a.charAt(i) === b.charAt(j)){
11
+ counter++;
12
+ break;
13
14
15
16
+ if (counter === a.length){
17
+ return true;
18
+ } return false;
19
20
+}
0 commit comments