CodeToLive

Coding Problems

Practice your coding skills with our collection of problems. Click on a problem to view its details.

Two Sum

Find indices of two numbers in an array that add up to a specific target.

View Problem Solve

Maximum Subarray

Find the contiguous subarray with the largest sum.

View Problem Solve

Product of Array Except Self

Return an array such that each element is the product of all elements except itself.

View Problem Solve

Reverse a String

Write a function to reverse a string in-place.

View Problem Solve

Check Anagram

Check if two strings are anagrams of each other.

View Problem Solve

Longest Substring Without Repeating Characters

Find the longest substring without repeating characters.

View Problem Solve

Factorial

Find the factorial of a number using recursion.

View Problem Solve

Fibonacci Sequence

Generate the Fibonacci sequence up to a given number.

View Problem Solve

Tower of Hanoi

Move N disks from one rod to another using recursion.

View Problem Solve

Climbing Stairs

Count the number of distinct ways to climb a staircase.

View Problem Solve

Knapsack Problem

Solve the 0/1 Knapsack problem using dynamic programming.

View Problem Solve

Edit Distance

Find the minimum number of operations to convert one string to another.

View Problem Solve

Binary Tree Inorder Traversal

Perform an inorder traversal of a binary tree.

View Problem Solve

Lowest Common Ancestor

Find the lowest common ancestor of two nodes in a binary tree.

View Problem Solve

Validate Binary Search Tree

Check if a binary tree is a valid binary search tree.

View Problem Solve

Graph Valid Tree

Determine if a given graph is a valid tree.

View Problem Solve

Number of Islands

Count the number of islands in a 2D grid.

View Problem Solve

Course Schedule

Determine if you can finish all courses given their prerequisites.

View Problem Solve

Single Number

Find the number that appears only once in an array where every other number appears twice.

View Problem Solve

Hamming Distance

Calculate the Hamming distance between two integers.

View Problem Solve

Jump Game

Determine if you can reach the last index of an array with given jumps.

View Problem Solve

Top K Frequent Elements

Find the K most frequent elements in an array.

View Problem Solve

Implement Trie

Design and implement a Trie (prefix tree).

View Problem Solve

Group Anagrams

Group words that are anagrams of each other.

View Problem Solve

Merge Intervals

Merge overlapping intervals in a list.

View Problem Solve

Binary Search

Find a target element in a sorted array.

View Problem Solve

Reverse Linked List

Reverse a singly linked list.

View Problem Solve

Sliding Window Maximum

Find the maximum element in every sliding window of size k.

View Problem Solve

Search in Rotated Sorted Array

Search for a target element in a rotated sorted array.

View Problem Solve

Range Sum Query

Find the sum of elements in a given range using a segment tree.

View Problem Solve

Number of Connected Components

Find the number of connected components in an undirected graph.

View Problem Solve

Convex Hull

Find the convex hull of a set of points.

View Problem Solve

Binary Tree Right Side View

Return the values of the nodes that are visible from the right side of a binary tree.

View Problem Solve

Find Peak Element

Find a peak element in an unsorted array.

View Problem Solve

Find Missing Number

Find the missing number in an array containing numbers from 1 to N.

View Problem Solve

Find Duplicate Number

Find the duplicate number in an array of N+1 elements.

View Problem Solve

Merge Sorted Arrays

Merge two sorted arrays into a single sorted array.

View Problem Solve

Find Intersection of Two Arrays

Find common elements between two arrays.

View Problem Solve

Rotate Array

Rotate an array to the right by K steps.

View Problem Solve

Maximum Product Subarray

Find the contiguous subarray that gives the maximum product.

View Problem Solve

Subarray Sum Equals K

Find the number of subarrays whose sum equals K.

View Problem Solve

Network Delay Time

Find the time it takes for all nodes to receive a signal in a weighted graph.

View Problem Solve

Longest Palindromic Substring

Find the longest palindromic substring in a string.

View Problem Solve

Word Break

Determine if a string can be segmented into words from a dictionary.

View Problem Solve

Longest Common Subsequence

Find the length of the longest common subsequence between two strings.

View Problem Solve

Minimum Path Sum

Find the path with the minimum sum from top-left to bottom-right in a grid.

View Problem Solve

Unique Paths

Find the number of unique paths from top-left to bottom-right in a grid.

View Problem Solve

N-Queens

Place N queens on an N×N chessboard such that no two queens threaten each other.

View Problem Solve

Merge K Sorted Lists

Merge k sorted linked lists into one sorted linked list.

View Problem Solve

Maximum Subarray

Find the contiguous subarray with the largest sum.

View Problem Solve

Spiral Matrix

Return all elements of a matrix in spiral order.

View Problem Solve

Jump Game

Determine if you can reach the last index of an array.

View Problem Solve

Merge Intervals

Merge all overlapping intervals.

View Problem Solve

Insert Interval

Insert a new interval into a sorted list of non-overlapping intervals.

View Problem Solve

Length of Last Word

Find the length of the last word in a string.

View Problem Solve

Spiral Matrix II

Generate a square matrix filled with elements from 1 to n^2 in spiral order.

View Problem Solve

Permutation Sequence

Find the kth permutation sequence of n numbers.

View Problem Solve

Rotate List

Rotate a linked list to the right by k places.

View Problem Solve

Unique Paths

Find the number of unique paths from top-left to bottom-right corner of a grid.

View Problem Solve

Unique Paths II

Find unique paths in a grid with obstacles.

View Problem Solve

Minimum Path Sum

Find the path with the minimum sum from top-left to bottom-right in a grid.

View Problem Solve

Find the Majority Element

Find the element that appears more than N/2 times.

View Problem Solve

Find the First and Last Position of Element

Find the starting and ending position of a given target.

View Problem Solve

Sort Colors

Sort an array containing 0s, 1s, and 2s.

View Problem Solve

Maximize Sum of Array After K Negations

Maximize the sum of an array by flipping at most K elements.

View Problem Solve

Find Kth Largest Element

Find the Kth largest element in an array.

View Problem Solve

Three Sum

Find all unique triplets that sum up to zero.

View Problem Solve

Find Two Elements That Sum to K

Find two elements in an array that add up to a target value K.

View Problem Solve

Find the Next Permutation

Find the next lexicographical permutation of a sequence.

View Problem Solve

Find the Majority Element II

Find all elements that appear more than N/3 times in an array.

View Problem Solve

Maximum Gap

Find the maximum difference between two elements in an array.

View Problem Solve

K-th Smallest in Lexicographical Order

Find the K-th smallest number in lexicographical order among all integers from 1 to N.

View Problem Solve

Find K-th Smallest Pair Distance

Find the K-th smallest distance between two elements in an array.

View Problem Solve

Maximize Distance to Closest Person

Find the maximum distance to the closest person in a row of seats.

View Problem Solve

Minimum Number of Arrows to Burst Balloons

Find the minimum number of arrows needed to burst all balloons.

View Problem Solve

Minimum Number of Refueling Stops

Find the minimum number of refueling stops needed to reach a destination.

View Problem Solve

Minimum Cost to Merge Stones

Find the minimum cost to merge stones into a single pile.

View Problem Solve

Minimum Number of Operations to Make Array Continuous

Find the minimum number of operations needed to make an array continuous.

View Problem Solve

Minimum Number of Operations to Make Array Sorted

Find the minimum number of operations needed to make an array sorted.

View Problem Solve

Minimum Number of Operations to Make Array Sorted II

Find the minimum number of operations needed to make an array sorted.

View Problem Solve

Merge Sort

Implement merge sort to sort an array in ascending order.

View Problem Solve

Range Minimum Query

Find the minimum value in a given range using a segment tree.

View Problem Solve

Union-Find with Path Compression

Implement a union-find data structure with path compression.

View Problem Solve

Rabin-Karp Algorithm

Use the Rabin-Karp algorithm for string matching.

View Problem Solve

Largest Rectangle in Histogram

Find the largest rectangular area in a histogram.

View Problem Solve

Line Segment Intersection

Check if two given line segments intersect.

View Problem Solve

Permutations of a Set

Generate all permutations of a given set.

View Problem Solve

Extended Euclidean Algorithm

Find the modular inverse of a number using the Extended Euclidean Algorithm.

View Problem Solve

Reverse Linked List II

Reverse a linked list from position left to position right.

View Problem Solve

Restore IP Addresses

Given a string containing only digits, restore it by returning all possible valid IP address combinations.

View Problem Solve

Binary Tree Inorder Traversal

Given the root of a binary tree, return the inorder traversal of its nodes' values.

View Problem Solve

Unique Binary Search Trees II

Generate all structurally unique BSTs that store values 1...n.

View Problem Solve

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.

View Problem Solve

Interleaving String

Given strings s1, s2, and s3, determine if s3 is formed by interleaving s1 and s2.

View Problem Solve

Validate Binary Search Tree

Determine if a binary tree is a valid binary search tree (BST).

View Problem Solve

Recover Binary Search Tree

Recover a BST where exactly two nodes were swapped by mistake.

View Problem Solve

Same Tree

Check if two binary trees are identical in structure and node values.

View Problem Solve

Symmetric Tree

Check if a binary tree is a mirror of itself (symmetric around its center).

View Problem Solve

Binary Tree Level Order Traversal

Return the level order traversal of a binary tree's nodes' values.

View Problem Solve

Binary Tree Zigzag Level Order Traversal

Return the zigzag level order traversal of a binary tree's nodes' values.

View Problem Solve

Maximum Depth of Binary Tree

Find the maximum depth (height) of a binary tree.

View Problem Solve

Construct Binary Tree from Preorder and Inorder Traversal

Construct a binary tree from its preorder and inorder traversal.

View Problem Solve

Construct Binary Tree from Inorder and Postorder Traversal

Construct a binary tree from its inorder and postorder traversal.

View Problem Solve

Binary Tree Level Order Traversal II

Return the bottom-up level order traversal of a binary tree's nodes' values.

View Problem Solve

Convert Sorted Array to Binary Search Tree

Convert a sorted array into a height-balanced binary search tree.

View Problem Solve

Convert Sorted List to Binary Search Tree

Convert a sorted linked list into a height-balanced binary search tree.

View Problem Solve

Balanced Binary Tree

Determine if a binary tree is height-balanced.

View Problem Solve

Minimum Depth of Binary Tree

Find the minimum depth of a binary tree.

View Problem Solve

Path Sum

Determine if a binary tree has a root-to-leaf path with a specified sum.

View Problem Solve

Path Sum II

Find all root-to-leaf paths where the sum equals the target sum.

View Problem Solve

Flatten Binary Tree to Linked List

Flatten a binary tree into a linked list in-place.

View Problem Solve

Distinct Subsequences

Count the number of distinct subsequences of s that equal t.

View Problem Solve

Populating Next Right Pointers in Each Node

Connect each node with its next right node in a perfect binary tree.

View Problem Solve

Populating Next Right Pointers in Each Node II

Connect each node with its next right node in any binary tree.

View Problem Solve

Pascal's Triangle

Generate the first numRows of Pascal's triangle.

View Problem Solve

Pascal's Triangle II

Return the rowIndex-th row of Pascal's triangle.

View Problem Solve

Triangle

Find the minimum path sum from top to bottom in a triangle array.

View Problem Solve

Best Time to Buy and Sell Stock

Find the maximum profit by buying and selling a stock once.

View Problem Solve

Best Time to Buy and Sell Stock II

Find the maximum profit by buying and selling stocks multiple times.

View Problem Solve

Best Time to Buy and Sell Stock III

Find the maximum profit by completing at most two transactions.

View Problem Solve

Binary Tree Maximum Path Sum

Find the maximum path sum between any two nodes in a binary tree.

View Problem Solve

Valid Palindrome

Determine if a string is a valid palindrome considering only alphanumeric characters.

View Problem Solve

Word Ladder II

Find all shortest transformation sequences from beginWord to endWord.

View Problem Solve

Word Ladder

Find the shortest transformation sequence length from beginWord to endWord.

View Problem Solve

Longest Consecutive Sequence

Find the length of the longest consecutive sequence in an unsorted array.

View Problem Solve

Sum Root to Leaf Numbers

Calculate the total sum of all root-to-leaf numbers in a binary tree.

View Problem Solve

Surrounded Regions

Capture all regions surrounded by 'X' in a board.

View Problem Solve

Palindrome Partitioning

Find all possible palindrome partitioning of a string.

View Problem Solve

Palindrome Partitioning II

Find the minimum cuts needed for palindrome partitioning of a string.

View Problem Solve

Clone Graph

Create a deep copy of a connected undirected graph.

View Problem Solve

Gas Station

Determine if you can complete a circular route starting from any gas station.

View Problem Solve

Candy

Distribute candies to children based on their ratings.

View Problem Solve

Word Break

Determine if a string can be segmented into space-separated dictionary words.

View Problem Solve

Reorder List

Reorder a linked list by interleaving the first half with the reversed second half.

View Problem Solve

Maximum Product Subarray

Find the contiguous subarray with the largest product.

View Problem Solve

Course Schedule II

Find a valid order to take all courses given their prerequisites.

View Problem Solve

Add and Search Word

Design a data structure that supports adding and searching words with wildcards.

View Problem Solve

Rotate Image

Rotate an n x n matrix 90 degrees clockwise in-place.

View Problem Solve

Basic Calculator

Implement a basic calculator to evaluate arithmetic expressions with parentheses.

View Problem Solve

Continuous Subarray Sum

Find if there exists a continuous subarray that sums to a multiple of k.

View Problem Solve

Counting Bits

Count the number of 1's in the binary representation of every number from 0 to n.

View Problem Solve

Sliding Window Maximum

Find the maximum element in each sliding window of size k.

View Problem Solve

Nim Game

Determine if you can win a game where players take turns removing stones.

View Problem Solve

Random Pick with Weight

Implement a data structure that picks an element with probability proportional to its weight.

View Problem Solve

Longest Repeating Substring

Find the longest substring that appears at least twice in a string using suffix arrays.

View Problem Solve

Maximum Flow

Find the maximum flow in a flow network using Ford-Fulkerson algorithm.

View Problem Solve

Traveling Salesman Problem

Find an approximate solution to the traveling salesman problem using nearest neighbor.

View Problem Solve

KMP Pattern Matching

Implement the Knuth-Morris-Pratt pattern matching algorithm.

View Problem Solve

Number of Islands II

Handle dynamic addition of lands and count number of islands in real-time.

View Problem Solve

Count Different Palindromic Subsequences

Count the number of different palindromic subsequences in a string.

View Problem Solve

Rectangle Overlap

Determine if two rectangles overlap in 2D space.

View Problem Solve

Prime Factorization Queries

Efficiently handle multiple prime factorization queries using preprocessing.

View Problem Solve

Next Greater Element II

Find the next greater element for each element in a circular array.

View Problem Solve

Design Circular Deque

Implement a circular double-ended queue with all operations in O(1) time.

View Problem Solve

Find Median from Data Stream

Design a data structure that can find the median of a stream of numbers.

View Problem Solve

Median of Two Sorted Arrays

Find the median of two sorted arrays in logarithmic time complexity.

View Problem Solve

Split Array Largest Sum

Split an array into m subarrays to minimize the largest sum among them.

View Problem Solve

Single Number II

Find the element that appears only once in an array where every other element appears three times.

View Problem Solve

Group Shifted Strings

Group strings that are shifted versions of each other.

View Problem Solve

Best Time to Buy and Sell Stock IV

Find the maximum profit with at most k transactions.

View Problem Solve

Minimum Cost to Connect Sticks

Connect sticks with minimum cost using a priority queue.

View Problem Solve

Find All Duplicates in an Array

Find all duplicates in an array without using extra space.

View Problem Solve

Longest Substring with At Most K Distinct Characters

Find the length of the longest substring with at most k distinct characters.

View Problem Solve

Palindrome Partitioning III

Partition a string such that every substring is a palindrome with minimum cuts.

View Problem Solve

Maximum Length of Repeated Subarray

Find the maximum length of a subarray that appears in both arrays.

View Problem Solve

Minimum Window Substring

Find the minimum window in a string that contains all characters of another string.

View Problem Solve

Longest Increasing Subsequence

Find the length of the longest increasing subsequence in an array.

View Problem Solve

Rotate Array II

Rotate an array to the right by k steps, where k is non-negative.

View Problem Solve

Count and Say

Generate the nth term of the count-and-say sequence.

View Problem Solve

Unique Paths III

Find the number of unique paths from the top-left to the bottom-right of a grid with obstacles.

View Problem Solve

Product of Array Except Self II

Return an array such that each element is the product of all elements except itself, without using division.

View Problem Solve

Longest Palindromic Subsequence

Find the length of the longest palindromic subsequence in a string.

View Problem Solve

Minimum Cost to Cut a Stick

Find the minimum cost to cut a stick into pieces of given lengths.

View Problem Solve

Course Schedule III

Find the maximum number of courses you can take given their start and end times.

View Problem Solve

Find the Kth Largest Element in an Array

Find the Kth largest element in an unsorted array.

View Problem Solve

Longest Repeating Character Replacement

Find the length of the longest substring that can be obtained by replacing at most k characters.

View Problem Solve

Word Break II

Given a string and a dictionary, return all possible sentences that can be formed by segmenting the string.

View Problem Solve

Number of Connected Components in an Undirected Graph

Count the number of connected components in a graph.

View Problem Solve

Find Minimum in Rotated Sorted Array

Find the minimum element in a rotated sorted array.

View Problem Solve

Implement strStr()

Implement the strStr() function to find the first occurrence of a substring in a string.

View Problem Solve

Longest Increasing Path in a Matrix

Find the length of the longest increasing path in a matrix.

View Problem Solve

Container With Most Water

Find two lines that together with the x-axis form a container that holds the most water.

View Problem Solve

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.

View Problem Solve

Best Time to Buy and Sell Stock with Cooldown

Find the maximum profit you can achieve with a cooldown period after selling.

View Problem Solve

Find All Anagrams in a String

Find all start indices of anagrams of a string in another string.

View Problem Solve

Longest Valid Parentheses

Find the length of the longest valid parentheses substring.

View Problem Solve

Edit Distance

Find the minimum number of operations required to convert one string into another.

View Problem Solve

Two Sum II - Input Array Is Sorted

Find two numbers such that they add up to a specific target in a sorted array.

View Problem Solve

Count Substrings with All Characters at Least K Times

Count the number of substrings where each character appears at least k times.

View Problem Solve

Maximum Product of Splitted Binary Tree

Find the maximum product of the sum of two subtrees after splitting a binary tree.

View Problem Solve

3Sum Closest

Find the sum of three integers that is closest to a target value.

View Problem Solve

Minimum Number of Deletions to Make a String Palindrome

Find the minimum number of deletions required to make a string a palindrome.

View Problem Solve

Longest Common Substring

Find the length of the longest common substring between two strings.

View Problem Solve

Find the Duplicate Number

Find the duplicate number in an array containing n + 1 integers where each integer is between 1 and n.

View Problem Solve

Minimum Window Substring II

Find the minimum window substring that contains all characters of another string, allowing duplicates.

View Problem Solve

Maximum Length of Repeated Subarray II

Find the maximum length of a repeated subarray in two arrays.

View Problem Solve

Subarray Product Less Than K

Find the number of contiguous subarrays where the product of all elements is less than k.

View Problem Solve

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.

View Problem Solve

Group Anagrams II

Given an array of strings, group the anagrams together.

View Problem Solve

Longest Palindromic Substring II

Find the longest palindromic substring in a string, allowing for one character to be removed.

View Problem Solve

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.

View Problem Solve

Course Schedule IV

Determine if you can finish all courses given their prerequisites, and return the order of courses.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

Minimum Cost to Merge Stones II

Find the minimum cost to merge stones into a single pile, allowing for a specific number of merges.

View Problem Solve

Longest Substring with At Most Two Distinct Characters

Find the length of the longest substring that contains at most two distinct characters.

View Problem Solve

Find the Maximum Length of a Repeated Subarray

Find the maximum length of a subarray that appears in both arrays.

View Problem Solve

Longest Increasing Subsequence II

Find the length of the longest increasing subsequence in an array, allowing for one character to be removed.

View Problem Solve

Minimum Window Substring III

Find the minimum window substring that contains all characters of another string, allowing for duplicates.

View Problem Solve

Find the Kth Smallest Element in a Sorted Matrix

Find the Kth smallest element in a sorted matrix.

View Problem Solve

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.

View Problem Solve

Longest Substring with At Most Three Distinct Characters

Find the length of the longest substring that contains at most three distinct characters.

View Problem Solve

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.

View Problem Solve

Longest Palindromic Substring III

Find the longest palindromic substring in a string, allowing for one character to be removed.

View Problem Solve

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.

View Problem Solve

Find the Kth Largest Element in a Sorted Matrix II

Find the Kth largest element in a sorted matrix.

View Problem Solve

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.

View Problem Solve

Minimum Window Substring IV

Find the minimum window substring that contains all characters of another string, allowing for duplicates.

View Problem Solve

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.

View Problem Solve

Longest Palindromic Substring IV

Find the longest palindromic substring in a string, allowing for one character to be removed.

View Problem Solve

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.

View Problem Solve

Find the Kth Largest Element in a Sorted Matrix III

Find the Kth largest element in a sorted matrix.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

Longest Palindromic Substring V

Find the longest palindromic substring in a string, allowing for two characters to be removed.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

Minimum Window Substring V

Find the minimum window substring that contains all characters of another string, allowing for two characters to be removed.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

Longest Palindromic Substring VI

Find the longest palindromic substring in a string, allowing for three characters to be removed.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

Longest Palindromic Substring VII

Find the longest palindromic substring in a string, allowing for four characters to be removed.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

Longest Palindromic Substring X

Find the longest palindromic substring in a string, allowing for five characters to be removed.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

Minimum Window Substring VI

Find the minimum window substring that contains all characters of another string, allowing for five characters to be removed.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

Longest Palindromic Substring XII

Find the longest palindromic substring in a string, allowing for six characters to be removed.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

Longest Palindromic Substring XIII

Find the longest palindromic substring in a string, allowing for seven characters to be removed.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

Longest Palindromic Substring XV

Find the longest palindromic substring in a string, allowing for six characters to be removed.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

Minimum Window Substring VII

Find the minimum window substring that contains all characters of another string, allowing for six characters to be removed.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

Longest Palindromic Substring XVI

Find the longest palindromic substring in a string, allowing for seven characters to be removed.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

Longest Palindromic Substring XVII

Find the longest palindromic substring in a string, allowing for eight characters to be removed.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

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.

View Problem Solve

Find the First Missing Positive

Given an unsorted integer array, find the smallest missing positive integer.

View Problem Solve

Implement strStr() III

Implement strStr() to locate a substring within a string, returning the index of the first occurrence.

View Problem Solve

Find the Largest Number in an Array

Given an array, find the largest number.

View Problem Solve

Check if a String is a Palindrome II

Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring case.

View Problem Solve

Remove Duplicates from Sorted Array III

Given a sorted array, remove duplicates in-place such that each element appears at most three times.

View Problem Solve

Count Vowels in a String II

Given a string, count the number of vowels in it.

View Problem Solve

Find the Sum of All Elements in an Array II

Given an array, find the sum of all its elements.

View Problem Solve

Check if Two Strings are Equal

Given two strings, check if they are equal.

View Problem Solve

Find the Second Smallest Element in an Array

Given an array, find the second smallest element.

View Problem Solve

Reverse a String II

Write a function that reverses a string. The input string is given as an array of characters.

View Problem Solve

Find the Maximum Difference Between Two Elements

Given an array, find the maximum difference between two elements.

View Problem Solve

Check if a String Contains Only Digits

Given a string, check if it contains only digits.

View Problem Solve

Find the Average of an Array

Given an array, find the average of its elements.

View Problem Solve

Count the Number of Words in a String

Given a string, count the number of words in it.

View Problem Solve

Find the Minimum Element in an Array

Given an array, find the minimum element.

View Problem Solve

Check if a String is a Substring of Another II

Given two strings, check if one is a substring of the other.

View Problem Solve

Find the Mode of an Array

Given an array, find the mode (the value that appears most frequently).

View Problem Solve

Check if a String is a Valid Email

Given a string, check if it is a valid email address.

View Problem Solve

Find the Unique Element in an Array

Given an array where every element appears twice except for one, find that unique element.

View Problem Solve

Count the Number of Consonants in a String

Given a string, count the number of consonants in it.

View Problem Solve