Created
February 26, 2017 11:34
-
-
Save vitkarpov/11c21297a60bfe32ab03c2e3f6339a40 to your computer and use it in GitHub Desktop.
"Cracking the coding interview", strings 1.2.1
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
/** | |
* Определяет является ли одна строка перестановкой другой. | |
* | |
* @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