function solution(before, after) {
let before_asc = [...before].sort();
let after_asc = [...after].sort();
return JSON.stringify(before_asc) === JSON.stringify(after_asc) ? 1 : 0
}
function solution(before, after) {
return before.split('').sort().join('') === after.split('').sort().join('') ? 1 : 0;
}