BudiBadu Logo

Check Palindrome

String Easy 1 views
Like17

The objective is to evaluate whether the string s maintains structural identity when its character sequence is inverted. This verification requires a character-by-character symmetry check to determine if the string reads identically from start-to-finish and finish-to-start.

The final result must be a boolean indicator confirming whether the input possesses palindromic properties. This structural validation accounts for cases where character alignment must be perfectly mirrored across the central axis of the string.

Algorithm Flow

Recommendation Algorithm Flow for Check Palindrome - Budibadu
Recommendation Algorithm Flow for Check Palindrome - Budibadu

Best Answers

java
class Solution {
    public boolean is_palindrome(String s) {
        String rev = new StringBuilder(s).reverse().toString();
        return s.equals(rev);
    }
}