function solution(st) { let palindrome = st; let i = 0; while (palindrome !== palindrome.split('').reverse().join('')) { palindrome = st + st.slice(0, i).split('').reverse().join(''); i++; } return palindrome; }