Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

is palindrome java

public static boolean checkPalindrome(String str)
{     
 
    int len = str.length();

    for(int i = 0; i < len / 2; i++)  {
        if (str.charAt(i) != str.charAt(len - i - 1))
            return false;
    }
    return true;
}
Source by leetcode.com #
 
PREVIOUS NEXT
Tagged: #palindrome #java
ADD COMMENT
Topic
Name
8+3 =