🧩 Two Pointers & Strings
1. Valid Palindrome
Example 1:
Input: s = "A man, a plan, a canal: Panama"
Output: true
Explanation: "amanaplanacanalpanama" is a palindrome.Example 2:
Input: s = "race a car"
Output: false
Explanation: "raceacar" is not a palindrome.Example 3:
Input: s = " "
Output: true
Explanation: s is an empty string "" after removing non-alphanumeric characters.
Since an empty string reads the same forward and backward, it is a palindrome.Constraints:
2. Longest Palindrome
Example 1:
Example 2:
Constraints:
3. Roman to Integer
Example 1:
Example 2:
Example 3:
Constraints:
4. Backspace String Compare
Example 1:
Example 2:
Last updated