Sobes.tech
Intern — Middle

Determining if a string is a palindrome

livecode

Task condition

A string s is given. It is required to check whether it is a palindrome. Two steps must be performed:

  1. Convert all uppercase characters to lowercase.
  2. Remove from the string all characters that are not letters or digits. After these transformations, the string is considered a palindrome if its sequence of characters reads the same from left to right and from right to left.
class Solution {
    public boolean isPalindrome(String s) {
        return false;
    }
}