문제 링크 : Permutation Difference between Two Strings
/** * @param {string} s * @param {string} t * @return {number} */ var findPermutationDifference = function(s, t) { let sum = 0 for(let el of s) { sum += Math.abs(s.indexOf(el) - t.indexOf(el)) } return sum };