Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
function isPalindrome(word) {
// Write your algorithm here
console.log(isPalindrome("madam"));
console.log(isPalindrome("robot"));
console.log(isPalindrome("racecar"));
console.log(isPalindrome("hello"));
console.log(isPalindrome("level"));
console.log(isPalindrome("A man, a plan, a canal, Panama"));

}

/*
Add your pseudocode here
*/
*/FUNCTION isPalindrome(str)
strLower = CONVERT_TO_LOWERCASE(str) // Convert the string to lowercase
reversedStr = REVERSE_STRING(strLower) // Reverse the string
RETURN strLower EQUALS reversedStr // Check if the original string is equal to its reverse

/*
Add written explanation of your solution here
Expand Down