Skip to content

Instantly share code, notes, and snippets.

@vitkarpov
Created February 26, 2017 11:34
Show Gist options
  • Save vitkarpov/11c21297a60bfe32ab03c2e3f6339a40 to your computer and use it in GitHub Desktop.
Save vitkarpov/11c21297a60bfe32ab03c2e3f6339a40 to your computer and use it in GitHub Desktop.
"Cracking the coding interview", strings 1.2.1
/**
* Определяет является ли одна строка перестановкой другой.
*
* @param {string} a
* @param {string} b
* @returns {boolean}
*/
function isPermutation(a, b) {
return a.split('').sort().join('') === b.split('').sort().join('');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment