Created
April 16, 2019 10:21
-
-
Save 4skinSkywalker/cd08d15edf3fa8eaad31611ccc5d1d29 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function same(a1, a2) { | |
| if (a1.length !== a2.length) | |
| return false | |
| let fc1 = frequencyCounter(a1) | |
| let fc2 = frequencyCounter(a2) | |
| for (let key in fc1) | |
| if (!key in fc2 || fc1[key] !== fc2[key]) | |
| return false | |
| return true | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment