Break a Palindrome Algorithm | TikTok Interview Question