Coding Problems
Practice your coding skills with our collection of problems. Click on a problem to view its details.
Find Intersection of Two Arrays
Find common elements between two arrays.
Product of Array Except Self
Return an array such that each element is the product of all elements except itself.
Longest Substring Without Repeating Characters
Find the longest substring without repeating characters.
Fibonacci Sequence
Generate the Fibonacci sequence up to a given number.
Tower of Hanoi
Move N disks from one rod to another using recursion.
Climbing Stairs
Count the number of distinct ways to climb a staircase.
Knapsack Problem
Solve the 0/1 Knapsack problem using dynamic programming.
Edit Distance
Find the minimum number of operations to convert one string to another.
Binary Tree Inorder Traversal
Perform an inorder traversal of a binary tree.
Lowest Common Ancestor
Find the lowest common ancestor of two nodes in a binary tree.
Validate Binary Search Tree
Check if a binary tree is a valid binary search tree.
Course Schedule
Determine if you can finish all courses given their prerequisites.
Single Number
Find the number that appears only once in an array where every other number appears twice.
Hamming Distance
Calculate the Hamming distance between two integers.
Jump Game
Determine if you can reach the last index of an array with given jumps.
Sliding Window Maximum
Find the maximum element in every sliding window of size k.
Search in Rotated Sorted Array
Search for a target element in a rotated sorted array.
Range Sum Query
Find the sum of elements in a given range using a segment tree.
Number of Connected Components
Find the number of connected components in an undirected graph.
Binary Tree Right Side View
Return the values of the nodes that are visible from the right side of a binary tree.
Find Missing Number
Find the missing number in an array containing numbers from 1 to N.
Find Duplicate Number
Find the duplicate number in an array of N+1 elements.
Merge Sorted Arrays
Merge two sorted arrays into a single sorted array.
Find Intersection of Two Arrays
Find common elements between two arrays.
Maximum Product Subarray
Find the contiguous subarray that gives the maximum product.
Subarray Sum Equals K
Find the number of subarrays whose sum equals K.
Network Delay Time
Find the time it takes for all nodes to receive a signal in a weighted graph.
Longest Palindromic Substring
Find the longest palindromic substring in a string.
Word Break
Determine if a string can be segmented into words from a dictionary.
Longest Common Subsequence
Find the length of the longest common subsequence between two strings.
Minimum Path Sum
Find the path with the minimum sum from top-left to bottom-right in a grid.
Unique Paths
Find the number of unique paths from top-left to bottom-right in a grid.
N-Queens
Place N queens on an N×N chessboard such that no two queens threaten each other.
Merge K Sorted Lists
Merge k sorted linked lists into one sorted linked list.
Insert Interval
Insert a new interval into a sorted list of non-overlapping intervals.
Spiral Matrix II
Generate a square matrix filled with elements from 1 to n^2 in spiral order.
Unique Paths
Find the number of unique paths from top-left to bottom-right corner of a grid.
Unique Paths II
Find unique paths in a grid with obstacles.
Minimum Path Sum
Find the path with the minimum sum from top-left to bottom-right in a grid.
Find the Majority Element
Find the element that appears more than N/2 times.
Find the First and Last Position of Element
Find the starting and ending position of a given target.
Maximize Sum of Array After K Negations
Maximize the sum of an array by flipping at most K elements.
Find Two Elements That Sum to K
Find two elements in an array that add up to a target value K.
Find the Next Permutation
Find the next lexicographical permutation of a sequence.
Find the Majority Element II
Find all elements that appear more than N/3 times in an array.
Maximum Gap
Find the maximum difference between two elements in an array.
K-th Smallest in Lexicographical Order
Find the K-th smallest number in lexicographical order among all integers from 1 to N.
Find K-th Smallest Pair Distance
Find the K-th smallest distance between two elements in an array.
Maximize Distance to Closest Person
Find the maximum distance to the closest person in a row of seats.
Minimum Number of Arrows to Burst Balloons
Find the minimum number of arrows needed to burst all balloons.
Minimum Number of Refueling Stops
Find the minimum number of refueling stops needed to reach a destination.
Minimum Cost to Merge Stones
Find the minimum cost to merge stones into a single pile.
Minimum Number of Operations to Make Array Continuous
Find the minimum number of operations needed to make an array continuous.
Minimum Number of Operations to Make Array Sorted
Find the minimum number of operations needed to make an array sorted.
Minimum Number of Operations to Make Array Sorted II
Find the minimum number of operations needed to make an array sorted.
Merge Sort
Implement merge sort to sort an array in ascending order.
Range Minimum Query
Find the minimum value in a given range using a segment tree.
Union-Find with Path Compression
Implement a union-find data structure with path compression.
Rabin-Karp Algorithm
Use the Rabin-Karp algorithm for string matching.
Largest Rectangle in Histogram
Find the largest rectangular area in a histogram.
Line Segment Intersection
Check if two given line segments intersect.
Permutations of a Set
Generate all permutations of a given set.
Extended Euclidean Algorithm
Find the modular inverse of a number using the Extended Euclidean Algorithm.
Reverse Linked List II
Reverse a linked list from position left to position right.
Restore IP Addresses
Given a string containing only digits, restore it by returning all possible valid IP address combinations.
Binary Tree Inorder Traversal
Given the root of a binary tree, return the inorder traversal of its nodes' values.
Unique Binary Search Trees II
Generate all structurally unique BSTs that store values 1...n.
Unique Binary Search Trees
Given n, return the number of structurally unique BSTs which has exactly n nodes of unique values from 1 to n.
Interleaving String
Given strings s1, s2, and s3, determine if s3 is formed by interleaving s1 and s2.
Validate Binary Search Tree
Determine if a binary tree is a valid binary search tree (BST).
Recover Binary Search Tree
Recover a BST where exactly two nodes were swapped by mistake.
Same Tree
Check if two binary trees are identical in structure and node values.
Symmetric Tree
Check if a binary tree is a mirror of itself (symmetric around its center).
Binary Tree Level Order Traversal
Return the level order traversal of a binary tree's nodes' values.
Binary Tree Zigzag Level Order Traversal
Return the zigzag level order traversal of a binary tree's nodes' values.
Maximum Depth of Binary Tree
Find the maximum depth (height) of a binary tree.
Construct Binary Tree from Preorder and Inorder Traversal
Construct a binary tree from its preorder and inorder traversal.
Construct Binary Tree from Inorder and Postorder Traversal
Construct a binary tree from its inorder and postorder traversal.
Binary Tree Level Order Traversal II
Return the bottom-up level order traversal of a binary tree's nodes' values.
Convert Sorted Array to Binary Search Tree
Convert a sorted array into a height-balanced binary search tree.
Convert Sorted List to Binary Search Tree
Convert a sorted linked list into a height-balanced binary search tree.
Balanced Binary Tree
Determine if a binary tree is height-balanced.
Minimum Depth of Binary Tree
Find the minimum depth of a binary tree.
Path Sum
Determine if a binary tree has a root-to-leaf path with a specified sum.
Path Sum II
Find all root-to-leaf paths where the sum equals the target sum.
Flatten Binary Tree to Linked List
Flatten a binary tree into a linked list in-place.
Distinct Subsequences
Count the number of distinct subsequences of s that equal t.
Populating Next Right Pointers in Each Node
Connect each node with its next right node in a perfect binary tree.
Populating Next Right Pointers in Each Node II
Connect each node with its next right node in any binary tree.
Triangle
Find the minimum path sum from top to bottom in a triangle array.
Best Time to Buy and Sell Stock
Find the maximum profit by buying and selling a stock once.
Best Time to Buy and Sell Stock II
Find the maximum profit by buying and selling stocks multiple times.
Best Time to Buy and Sell Stock III
Find the maximum profit by completing at most two transactions.
Binary Tree Maximum Path Sum
Find the maximum path sum between any two nodes in a binary tree.
Valid Palindrome
Determine if a string is a valid palindrome considering only alphanumeric characters.
Word Ladder II
Find all shortest transformation sequences from beginWord to endWord.
Word Ladder
Find the shortest transformation sequence length from beginWord to endWord.
Longest Consecutive Sequence
Find the length of the longest consecutive sequence in an unsorted array.
Sum Root to Leaf Numbers
Calculate the total sum of all root-to-leaf numbers in a binary tree.
Surrounded Regions
Capture all regions surrounded by 'X' in a board.
Palindrome Partitioning
Find all possible palindrome partitioning of a string.
Palindrome Partitioning II
Find the minimum cuts needed for palindrome partitioning of a string.
Gas Station
Determine if you can complete a circular route starting from any gas station.
Word Break
Determine if a string can be segmented into space-separated dictionary words.
Reorder List
Reorder a linked list by interleaving the first half with the reversed second half.
Maximum Product Subarray
Find the contiguous subarray with the largest product.
Course Schedule II
Find a valid order to take all courses given their prerequisites.
Add and Search Word
Design a data structure that supports adding and searching words with wildcards.
Basic Calculator
Implement a basic calculator to evaluate arithmetic expressions with parentheses.
Continuous Subarray Sum
Find if there exists a continuous subarray that sums to a multiple of k.
Counting Bits
Count the number of 1's in the binary representation of every number from 0 to n.
Sliding Window Maximum
Find the maximum element in each sliding window of size k.
Nim Game
Determine if you can win a game where players take turns removing stones.
Random Pick with Weight
Implement a data structure that picks an element with probability proportional to its weight.
Longest Repeating Substring
Find the longest substring that appears at least twice in a string using suffix arrays.
Maximum Flow
Find the maximum flow in a flow network using Ford-Fulkerson algorithm.
Traveling Salesman Problem
Find an approximate solution to the traveling salesman problem using nearest neighbor.
KMP Pattern Matching
Implement the Knuth-Morris-Pratt pattern matching algorithm.
Number of Islands II
Handle dynamic addition of lands and count number of islands in real-time.
Count Different Palindromic Subsequences
Count the number of different palindromic subsequences in a string.
Rectangle Overlap
Determine if two rectangles overlap in 2D space.
Prime Factorization Queries
Efficiently handle multiple prime factorization queries using preprocessing.
Next Greater Element II
Find the next greater element for each element in a circular array.
Design Circular Deque
Implement a circular double-ended queue with all operations in O(1) time.
Find Median from Data Stream
Design a data structure that can find the median of a stream of numbers.
Median of Two Sorted Arrays
Find the median of two sorted arrays in logarithmic time complexity.
Split Array Largest Sum
Split an array into m subarrays to minimize the largest sum among them.
Single Number II
Find the element that appears only once in an array where every other element appears three times.
Group Shifted Strings
Group strings that are shifted versions of each other.
Best Time to Buy and Sell Stock IV
Find the maximum profit with at most k transactions.
Minimum Cost to Connect Sticks
Connect sticks with minimum cost using a priority queue.
Find All Duplicates in an Array
Find all duplicates in an array without using extra space.
Longest Substring with At Most K Distinct Characters
Find the length of the longest substring with at most k distinct characters.
Palindrome Partitioning III
Partition a string such that every substring is a palindrome with minimum cuts.
Maximum Length of Repeated Subarray
Find the maximum length of a subarray that appears in both arrays.
Minimum Window Substring
Find the minimum window in a string that contains all characters of another string.
Longest Increasing Subsequence
Find the length of the longest increasing subsequence in an array.
Rotate Array II
Rotate an array to the right by k steps, where k is non-negative.
Unique Paths III
Find the number of unique paths from the top-left to the bottom-right of a grid with obstacles.
Product of Array Except Self II
Return an array such that each element is the product of all elements except itself, without using division.
Longest Palindromic Subsequence
Find the length of the longest palindromic subsequence in a string.
Minimum Cost to Cut a Stick
Find the minimum cost to cut a stick into pieces of given lengths.
Course Schedule III
Find the maximum number of courses you can take given their start and end times.
Find the Kth Largest Element in an Array
Find the Kth largest element in an unsorted array.
Longest Repeating Character Replacement
Find the length of the longest substring that can be obtained by replacing at most k characters.
Word Break II
Given a string and a dictionary, return all possible sentences that can be formed by segmenting the string.
Number of Connected Components in an Undirected Graph
Count the number of connected components in a graph.
Find Minimum in Rotated Sorted Array
Find the minimum element in a rotated sorted array.
Implement strStr()
Implement the strStr() function to find the first occurrence of a substring in a string.
Longest Increasing Path in a Matrix
Find the length of the longest increasing path in a matrix.
Container With Most Water
Find two lines that together with the x-axis form a container that holds the most water.
Minimum Add to Make Parentheses Valid
Given a string of parentheses, find the minimum number of parentheses you need to add to make it valid.
Best Time to Buy and Sell Stock with Cooldown
Find the maximum profit you can achieve with a cooldown period after selling.
Find All Anagrams in a String
Find all start indices of anagrams of a string in another string.
Longest Valid Parentheses
Find the length of the longest valid parentheses substring.
Edit Distance
Find the minimum number of operations required to convert one string into another.
Two Sum II - Input Array Is Sorted
Find two numbers such that they add up to a specific target in a sorted array.
Count Substrings with All Characters at Least K Times
Count the number of substrings where each character appears at least k times.
Maximum Product of Splitted Binary Tree
Find the maximum product of the sum of two subtrees after splitting a binary tree.
3Sum Closest
Find the sum of three integers that is closest to a target value.
Minimum Number of Deletions to Make a String Palindrome
Find the minimum number of deletions required to make a string a palindrome.
Longest Common Substring
Find the length of the longest common substring between two strings.
Find the Duplicate Number
Find the duplicate number in an array containing n + 1 integers where each integer is between 1 and n.
Minimum Window Substring II
Find the minimum window substring that contains all characters of another string, allowing duplicates.
Maximum Length of Repeated Subarray II
Find the maximum length of a repeated subarray in two arrays.
Subarray Product Less Than K
Find the number of contiguous subarrays where the product of all elements is less than k.
Find All Numbers Disappeared in an Array
Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] inclusive that do not appear in this array.
Group Anagrams II
Given an array of strings, group the anagrams together.
Longest Palindromic Substring II
Find the longest palindromic substring in a string, allowing for one character to be removed.
Find the Duplicate Subtree in a Binary Tree
Given a binary tree, find all duplicate subtrees. For each duplicate subtree, return a list of all of its root nodes.
Course Schedule IV
Determine if you can finish all courses given their prerequisites, and return the order of courses.
Minimum Number of Operations to Make a String Palindrome II
Find the minimum number of operations required to make a string a palindrome, allowing for one character to be removed.
Find the Longest Substring with At Most K Distinct Characters
Given a string, find the length of the longest substring that contains at most K distinct characters.
Minimum Cost to Merge Stones II
Find the minimum cost to merge stones into a single pile, allowing for a specific number of merges.
Longest Substring with At Most Two Distinct Characters
Find the length of the longest substring that contains at most two distinct characters.
Find the Maximum Length of a Repeated Subarray
Find the maximum length of a subarray that appears in both arrays.
Longest Increasing Subsequence II
Find the length of the longest increasing subsequence in an array, allowing for one character to be removed.
Minimum Window Substring III
Find the minimum window substring that contains all characters of another string, allowing for duplicates.
Find the Kth Smallest Element in a Sorted Matrix
Find the Kth smallest element in a sorted matrix.
Minimum Cost to Cut a Stick II
Find the minimum cost to cut a stick into pieces of given lengths, allowing for a specific number of merges.
Longest Substring with At Most Three Distinct Characters
Find the length of the longest substring that contains at most three distinct characters.
Find the Maximum Length of a Repeated Subarray II
Find the maximum length of a repeated subarray in two arrays, allowing for one character to be removed.
Longest Palindromic Substring III
Find the longest palindromic substring in a string, allowing for one character to be removed.
Minimum Number of Operations to Make a String Palindrome III
Find the minimum number of operations required to make a string a palindrome, allowing for one character to be removed.
Find the Kth Largest Element in a Sorted Matrix II
Find the Kth largest element in a sorted matrix.
Longest Increasing Path in a Matrix II
Find the length of the longest increasing path in a matrix, allowing for one character to be removed.
Minimum Window Substring IV
Find the minimum window substring that contains all characters of another string, allowing for duplicates.
Find the Maximum Length of a Repeated Subarray III
Find the maximum length of a repeated subarray in two arrays, allowing for one character to be removed.
Longest Palindromic Substring IV
Find the longest palindromic substring in a string, allowing for one character to be removed.
Minimum Number of Operations to Make a String Palindrome IV
Find the minimum number of operations required to make a string a palindrome, allowing for one character to be removed.
Find the Kth Largest Element in a Sorted Matrix III
Find the Kth largest element in a sorted matrix.
Find the Longest Substring with At Most Four Distinct Characters
Given a string, find the length of the longest substring that contains at most four distinct characters.
Minimum Number of Operations to Make a String Palindrome V
Find the minimum number of operations required to make a string a palindrome, allowing for two characters to be removed.
Longest Common Subsequence II
Find the length of the longest common subsequence between two strings, allowing for one character to be removed from each string.
Find the Maximum Length of a Repeated Subarray IV
Find the maximum length of a repeated subarray in two arrays, allowing for two characters to be removed.
Longest Palindromic Substring V
Find the longest palindromic substring in a string, allowing for two characters to be removed.
Minimum Cost to Cut a Stick III
Find the minimum cost to cut a stick into pieces of given lengths, allowing for two characters to be removed.
Find the Kth Largest Element in a Sorted Matrix IV
Find the Kth largest element in a sorted matrix, allowing for one character to be removed.
Minimum Window Substring V
Find the minimum window substring that contains all characters of another string, allowing for two characters to be removed.
Longest Increasing Path in a Matrix III
Find the length of the longest increasing path in a matrix, allowing for two characters to be removed.
Find the Maximum Length of a Repeated Subarray V
Find the maximum length of a repeated subarray in two arrays, allowing for two characters to be removed.
Minimum Number of Operations to Make a String Palindrome VI
Find the minimum number of operations required to make a string a palindrome, allowing for three characters to be removed.
Longest Common Subsequence III
Find the length of the longest common subsequence between two strings, allowing for two characters to be removed from each string.
Find the Kth Largest Element in a Sorted Matrix V
Find the Kth largest element in a sorted matrix, allowing for two characters to be removed.
Longest Palindromic Substring VI
Find the longest palindromic substring in a string, allowing for three characters to be removed.
Minimum Cost to Cut a Stick IV
Find the minimum cost to cut a stick into pieces of given lengths, allowing for three characters to be removed.
Find the Maximum Length of a Repeated Subarray VI
Find the maximum length of a repeated subarray in two arrays, allowing for three characters to be removed.
Minimum Number of Operations to Make a String Palindrome VII
Find the minimum number of operations required to make a string a palindrome, allowing for four characters to be removed.
Longest Common Subsequence IV
Find the length of the longest common subsequence between two strings, allowing for three characters to be removed from each string.
Find the Kth Largest Element in a Sorted Matrix VI
Find the Kth largest element in a sorted matrix, allowing for three characters to be removed.
Longest Palindromic Substring VII
Find the longest palindromic substring in a string, allowing for four characters to be removed.
Minimum Cost to Cut a Stick V
Find the minimum cost to cut a stick into pieces of given lengths, allowing for four characters to be removed.
Find the Maximum Length of a Repeated Subarray VII
Find the maximum length of a repeated subarray in two arrays, allowing for four characters to be removed.
Minimum Number of Operations to Make a String Palindrome VIII
Find the minimum number of operations required to make a string a palindrome, allowing for five characters to be removed.
Longest Common Subsequence V
Find the length of the longest common subsequence between two strings, allowing for four characters to be removed from each string.
Find the Kth Largest Element in a Sorted Matrix VII
Find the Kth largest element in a sorted matrix, allowing for four characters to be removed.
Find the Longest Substring with At Most Five Distinct Characters
Given a string, find the length of the longest substring that contains at most five distinct characters.
Minimum Number of Operations to Make a String Palindrome IX
Find the minimum number of operations required to make a string a palindrome, allowing for five characters to be removed.
Longest Common Subsequence VI
Find the length of the longest common subsequence between two strings, allowing for two characters to be removed from each string.
Find the Maximum Length of a Repeated Subarray VIII
Find the maximum length of a repeated subarray in two arrays, allowing for five characters to be removed.
Longest Palindromic Substring X
Find the longest palindromic substring in a string, allowing for five characters to be removed.
Minimum Cost to Cut a Stick VI
Find the minimum cost to cut a stick into pieces of given lengths, allowing for five characters to be removed.
Find the Kth Largest Element in a Sorted Matrix VIII
Find the Kth largest element in a sorted matrix, allowing for five characters to be removed.
Minimum Window Substring VI
Find the minimum window substring that contains all characters of another string, allowing for five characters to be removed.
Longest Increasing Path in a Matrix IV
Find the length of the longest increasing path in a matrix, allowing for five characters to be removed.
Find the Maximum Length of a Repeated Subarray IX
Find the maximum length of a repeated subarray in two arrays, allowing for five characters to be removed.
Minimum Number of Operations to Make a String Palindrome XI
Find the minimum number of operations required to make a string a palindrome, allowing for six characters to be removed.
Longest Common Subsequence VII
Find the length of the longest common subsequence between two strings, allowing for five characters to be removed from each string.
Find the Kth Largest Element in a Sorted Matrix IX
Find the Kth largest element in a sorted matrix, allowing for six characters to be removed.
Longest Palindromic Substring XII
Find the longest palindromic substring in a string, allowing for six characters to be removed.
Minimum Cost to Cut a Stick VII
Find the minimum cost to cut a stick into pieces of given lengths, allowing for six characters to be removed.
Find the Maximum Length of a Repeated Subarray X
Find the maximum length of a repeated subarray in two arrays, allowing for six characters to be removed.
Minimum Number of Operations to Make a String Palindrome XII
Find the minimum number of operations required to make a string a palindrome, allowing for seven characters to be removed.
Longest Common Subsequence VIII
Find the length of the longest common subsequence between two strings, allowing for six characters to be removed from each string.
Find the Kth Largest Element in a Sorted Matrix X
Find the Kth largest element in a sorted matrix, allowing for seven characters to be removed.
Longest Palindromic Substring XIII
Find the longest palindromic substring in a string, allowing for seven characters to be removed.
Minimum Cost to Cut a Stick VIII
Find the minimum cost to cut a stick into pieces of given lengths, allowing for seven characters to be removed.
Find the Maximum Length of a Repeated Subarray XI
Find the maximum length of a repeated subarray in two arrays, allowing for seven characters to be removed.
Minimum Number of Operations to Make a String Palindrome XIII
Find the minimum number of operations required to make a string a palindrome, allowing for eight characters to be removed.
Longest Common Subsequence IX
Find the length of the longest common subsequence between two strings, allowing for seven characters to be removed from each string.
Find the Kth Largest Element in a Sorted Matrix XI
Find the Kth largest element in a sorted matrix, allowing for eight characters to be removed.
Find the Longest Substring with At Most Six Distinct Characters
Given a string, find the length of the longest substring that contains at most six distinct characters.
Minimum Number of Operations to Make a String Palindrome XIV
Find the minimum number of operations required to make a string a palindrome, allowing for six characters to be removed.
Longest Common Subsequence X
Find the length of the longest common subsequence between two strings, allowing for three characters to be removed from each string.
Find the Maximum Length of a Repeated Subarray XII
Find the maximum length of a repeated subarray in two arrays, allowing for six characters to be removed.
Longest Palindromic Substring XV
Find the longest palindromic substring in a string, allowing for six characters to be removed.
Minimum Cost to Cut a Stick IX
Find the minimum cost to cut a stick into pieces of given lengths, allowing for six characters to be removed.
Find the Kth Largest Element in a Sorted Matrix XII
Find the Kth largest element in a sorted matrix, allowing for six characters to be removed.
Minimum Window Substring VII
Find the minimum window substring that contains all characters of another string, allowing for six characters to be removed.
Longest Increasing Path in a Matrix V
Find the length of the longest increasing path in a matrix, allowing for six characters to be removed.
Find the Maximum Length of a Repeated Subarray XIII
Find the maximum length of a repeated subarray in two arrays, allowing for six characters to be removed.
Minimum Number of Operations to Make a String Palindrome XV
Find the minimum number of operations required to make a string a palindrome, allowing for seven characters to be removed.
Longest Common Subsequence XI
Find the length of the longest common subsequence between two strings, allowing for six characters to be removed from each string.
Find the Kth Largest Element in a Sorted Matrix XIII
Find the Kth largest element in a sorted matrix, allowing for seven characters to be removed.
Longest Palindromic Substring XVI
Find the longest palindromic substring in a string, allowing for seven characters to be removed.
Minimum Cost to Cut a Stick X
Find the minimum cost to cut a stick into pieces of given lengths, allowing for seven characters to be removed.
Find the Maximum Length of a Repeated Subarray XIV
Find the maximum length of a repeated subarray in two arrays, allowing for seven characters to be removed.
Minimum Number of Operations to Make a String Palindrome XVI
Find the minimum number of operations required to make a string a palindrome, allowing for eight characters to be removed.
Longest Common Subsequence XII
Find the length of the longest common subsequence between two strings, allowing for seven characters to be removed from each string.
Find the Kth Largest Element in a Sorted Matrix XIV
Find the Kth largest element in a sorted matrix, allowing for eight characters to be removed.
Longest Palindromic Substring XVII
Find the longest palindromic substring in a string, allowing for eight characters to be removed.
Minimum Cost to Cut a Stick XI
Find the minimum cost to cut a stick into pieces of given lengths, allowing for eight characters to be removed.
Find the Maximum Length of a Repeated Subarray XV
Find the maximum length of a repeated subarray in two arrays, allowing for eight characters to be removed.
Minimum Number of Operations to Make a String Palindrome XVII
Find the minimum number of operations required to make a string a palindrome, allowing for nine characters to be removed.
Longest Common Subsequence XIII
Find the length of the longest common subsequence between two strings, allowing for eight characters to be removed from each string.
Find the Kth Largest Element in a Sorted Matrix XV
Find the Kth largest element in a sorted matrix, allowing for nine characters to be removed.
Find the First Missing Positive
Given an unsorted integer array, find the smallest missing positive integer.
Implement strStr() III
Implement strStr() to locate a substring within a string, returning the index of the first occurrence.
Find the Largest Number in an Array
Given an array, find the largest number.
Check if a String is a Palindrome II
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring case.
Remove Duplicates from Sorted Array III
Given a sorted array, remove duplicates in-place such that each element appears at most three times.
Count Vowels in a String II
Given a string, count the number of vowels in it.
Find the Sum of All Elements in an Array II
Given an array, find the sum of all its elements.
Check if Two Strings are Equal
Given two strings, check if they are equal.
Find the Second Smallest Element in an Array
Given an array, find the second smallest element.
Reverse a String II
Write a function that reverses a string. The input string is given as an array of characters.
Find the Maximum Difference Between Two Elements
Given an array, find the maximum difference between two elements.
Check if a String Contains Only Digits
Given a string, check if it contains only digits.
Find the Average of an Array
Given an array, find the average of its elements.
Count the Number of Words in a String
Given a string, count the number of words in it.
Find the Minimum Element in an Array
Given an array, find the minimum element.
Check if a String is a Substring of Another II
Given two strings, check if one is a substring of the other.
Find the Mode of an Array
Given an array, find the mode (the value that appears most frequently).
Check if a String is a Valid Email
Given a string, check if it is a valid email address.
Find the Unique Element in an Array
Given an array where every element appears twice except for one, find that unique element.
Count the Number of Consonants in a String
Given a string, count the number of consonants in it.