Valid Palindrome?

Given a string s, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. A palindrome is a word, phrase, number, or other sequences of characters that…

Two Sum II – Input Array is Sorted

Given an array numbers that is sorted in non-decreasing order and a target target, find two numbers in the array such that they add up to the target. You may…

3 Sum Problem

Given an array nums of n integers, find all unique triplets in the array that sum up to zero. Each triplet must be in non-descending order (i.e., the elements of…

Container With Most Water

Given an array height of non-negative integers representing the heights of lines on a 2D plane, where the width of each line is 1, find two lines which, together with…

Peak Index in a Mountain Array

Given an array of integers arr that represents a mountain, you need to find the peak index. A peak index is an index such that arr arr.…

Find Smallest Letter Greater Than Target

Given a sorted list of lowercase letters letters and a target letter target, you need to find the smallest letter in the list that is greater than the target. If…

Binary Search Problem

Binary Search is a classic searching algorithm that efficiently finds the target element in a sorted array. Given a sorted array of integers nums and a target element target, you…

Single Element in a Sorted Array

Given a sorted array of integers where every element appears twice except for one, you need to find that single element that appears only once.

Search in Rotated Sorted Array

We can solve this problem using a modified binary search algorithm. We can identify whether the target element lies in the left or right half of the rotated array based…