242. Valid Anagram
https://leetcode.com/problems/valid-anagram/description/ var isAnagram = function(s, t) { if(s.length !== t.length) return false; const sMap = {}; const tMap = {}; (…s).forEach(key => sMap(key) = (sMap(key) || 0) + 1 ); (…t).forEach(key => tMap(key) = (tMap(key) || 0) + 1 ); for(let sKey of Object.keys(sMap)) { if(!tMap(sKey)) { return false; } if(tMap(sKey) !== sMap(sKey)) { return … Read more