Loading...
Engaged Employer
Given a string how would you check if the string is a palindrome?
Anonymous
In Python: string == string[::-1]
function isPalindrome(str) { if (str.length == 0) console.log("No string given") var newstr=str.toLowerCase().split(" ").join(""); newstr = newstr.split("").reverse().join(""); if(str == newstr) console.log("Palindrome"); else console.log("Not a Palindrome"); } isPalindrome("hello world"); isPalindrome("poop");
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalized job recommendations and updates by starting your searches.