Write a method that takes a string and returns true if it is a palindrome. A palindrome is a string that is the same whether written backward or forward. Assume that there are no spaces; only lowercase letters will be given.
This is my answer that actually passed all the test cases:
This was my original solution. Still not sure why it did not work. (It returned true even for non-palindrome test cases):
Second time doing this:
I forgot the ‘return true’ at the end. Always put that in there. Don’t assume that it’ll return true if otherwise.