Palindrome Checker

 avatar
unknown
java
2 years ago
469 B
7
Indexable
public class PalindromeChecker {
    public static void main(String[] args) {
        System.out.println(isPalindrome("A man, a plan, a canal, Panama")); // true
        System.out.println(isPalindrome("racecar")); // true
        System.out.println(isPalindrome("hello")); // false
    }

    public static boolean isPalindrome(String str) {
        // Your code here
        
        // Return true if the string is a palindrome, false otherwise
    }
}
Editor is loading...