palindromic string exercise with required changes