#100 Palindrome String Check
Write a function that checks whether a given string is a palindrome, with the memory restriction that the input string cannot be modified and no additional data structures may be used.
Additional conditions:
The string may contain both Cyrillic and Latin letters. Letters may use different cases, for example, "Казак" and "казак" are considered palindromes. Ignore punctuation marks such as commas, apostrophes, exclamation marks, question marks, and so on.
Example:
Input: "Казак!"
Output: true (ignoring the ! character and letter case, this is a palindrome).
Constraint:
Running time: O(n), where n is the string length.
Question review
Sign in to start the dialogue
The mentor keeps the context of the current question and your previous messages.
Sign in
Available with Premium
This is just one of the solutions available with Premium. And more:
- 250+ advanced lectures
- 1300+ practice exercises
- 500+ solutions to problems from real interviews
- Personalized Java Hub certificates
- Expanded access to the AI mentor