📄️ Guidelines
If there is a specific order (e.g. array is sorted) always think how you can utilize the two pointer approach, by comparing both ends of the array and making the decision based on their comparison. If the array is not sorted think if you can get an optimal solution by first sorting the array and then using the two pointer approach.
📄️ Valid Palindrome
A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers.
📄️ Squares of a Sorted Array
Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.
📄️ Backspace String Compare
Given two strings s and t, return true if they are equal when both are typed into empty text editors. '#' means a backspace character.
📄️ 3Sum
Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
📄️ 3Sum Closest
Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target.
📄️ Container With Most Water
You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the...
📄️ Next Permutation
A permutation of an array of integers is an arrangement of its members into a sequence or linear order.
📄️ Subarray Product Less Than K
Given an array of integers nums and an integer k, return the number of contiguous subarrays where the product of all the elements in the subarray is strictly less than k.
📄️ Sort Colors
Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.
📄️ Trapping Rain Water
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.