Illustration showing how a string is checked to determine if it is a palindrome

How to check if a string is a Valid Palindrome: O(n) two pointer solution explained

Problem Overview We are given a string s. The string consists of all printable ASCII characters. Goal is to check if the string is a palindrome — but first we need to remove non-alphanumeric characters, then check. A palindrome is a word or sentence if that reads the same backwards as forewords LeetCode - Valid Palindrome Example 1 2 3 4 5 6 7 Input: s = "A man, a plan, a canal: Panama" Output: true Explanation: "amanaplanacanalpanama" is a palindrome. Input: s = "race a car" Output: false Explanation: "raceacar" is not a palindrome. ...

March 17, 2026 · 3 min · 589 words · Hitesh Patel
Illustration of the 'Container With Most Water' problem showing vertical bars and the maximum water area highlighted

Find the container with most water (Blind 75) — O(n) Solution

Problem Overview We are given an array heights of size n. The value at each index represents the height of a vertical bar. We need to find two bars such that together they can hold the maximum amount of water. Note: We are not allowed to slant the container. LeetCode - Container With Most Water Example Input: height = [1,8,6,2,5,4,8,3,7] Output: 49 ...

February 17, 2026 · 3 min · 435 words · Hitesh Patel