Problem: Detect whether a given string is a palindrome or not. A palindrome is a word that spells the same if it is reversed.
Examples:
Input: “madam”, Output: true
Input: “test”, Output: false
Input: “a”, Output: true
Input: “aabbaa”, Output: true
Algorithm:
1. Initialize two counters, one pointing to the first character, and the second to the last one
2. Iterate over the string. Compare the characters at the two locations. If the characters match then advance the front counter by 1 and the back counter by -1. If the characters don’t match, the string is not a palindrome.
3. If the two counters reach the same location, and everything has matched so far, the string is a palindrome
Java Code:

Love palindromes. Had a professor in college who plastered his whole office with palindromes.