#100 Palindrome String Check

Companies:
Yandex cdti
Themes:
AlgorithmsStringsPractice

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

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in