Skip to content

Instantly share code, notes, and snippets.

@4skinSkywalker
Created April 16, 2019 10:21
Show Gist options
  • Select an option

  • Save 4skinSkywalker/cd08d15edf3fa8eaad31611ccc5d1d29 to your computer and use it in GitHub Desktop.

Select an option

Save 4skinSkywalker/cd08d15edf3fa8eaad31611ccc5d1d29 to your computer and use it in GitHub Desktop.
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