Skip to content

Commit

Permalink
MOD : valid-anagram
Browse files Browse the repository at this point in the history
  • Loading branch information
GUMUNYEONG committed Aug 25, 2024
1 parent 68f8766 commit c690fd8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions valid-anagram/GUMUNYEONG.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
var isAnagram = function (s, t) {
const countHash = {};
let result = true;

if (s.length !== t.length) return false;

Expand All @@ -17,12 +16,11 @@ var isAnagram = function (s, t) {
if (countHash[str_s]) {
countHash[str_s]--;
} else {
result = false;
break;
return false;
}
}

return result;
return true;
};

// TC : O(n)
Expand Down

0 comments on commit c690fd8

Please sign in to comment.