Skip to content
Snippets Groups Projects
Select Git revision
  • f2037ee24dfeb30b2ed2de57085dc7321b13a84c
  • main default protected
2 results

Palindrome.java

  • Forked from LABOUREL Arnaud / M1 INFO FSI TP Template
    25 commits behind the upstream repository.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Palindrome.java 354 B
    package palindrome;
    
    public class Palindrome {
    
        static boolean isPalindrome(String s){
            if (s.length() == 0)
                return true;
            if (s.length() == 1)
                return true;
            if (s.charAt(0) != s.charAt(s.length()-1))
                return false;
            return Palindrome.isPalindrome(s.substring(1,s.length()-1));
        }
    
    }