function isPalindrome(str: string) {
// Normalize the string: remove spaces and convert to lowercase
const normalizedStr: string = str.replace(/\s+/g, '').toLowerCase();
// Reverse the normalized string
const reversedStr: string = normalizedStr.split('').reverse().join('');
// Check if the normalized string is equal to the reversed string
return normalizedStr === reversedStr;
}
console.log(isPalindrome("A man a plan a canal Panama"));
console.log(isPalindrome("abcDefg"));
/*
run:
true
false
*/