581. Shortest Unsorted Continuous Subarray
Problem Given an integer array nums, you need to find one continuous subarray such that if you only sort this subarray in non...
Problem Given an integer array nums, you need to find one continuous subarray such that if you only sort this subarray in non...
Problem You are given a 0-indexed array of strings words and a 2D array of integers queries. Each query queries[i] = [lᵢ, rᵢ]...
Problem You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a d...
Problem You are given an integer array nums and an array queries where queries[i] = [valᵢ, indexᵢ]. For each query i, first, ...
Problem Given a string s, rearrange the characters of s so that any two adjacent characters are not the same. Return any poss...
Problem You are given an integer matrix isWater of size m x n that represents a map of land and water cells. If isWater[i][j...
Problem Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell. The distance between two cells ...
Problem A company is planning to interview 2n people. Given the array costs where costs[i] = [aCostᵢ, bCostᵢ], the cost of fl...
Problem You are given an m x n binary matrix matrix. You can choose any number of columns in the matrix and flip every cell i...
Problem Given a singly linked list, return a random node’s value from the linked list. Each node must have the same probabili...
Problem Given an m x n binary matrix filled with 0’s and 1’s, find the largest square containing only 1’s and return its area...
Problem Given a string s of zeros and ones, return the maximum score after splitting the string into two non-empty substrings...
Problem You are given a string date representing a Gregorian calendar date in the yyyy-mm-dd format. date can be written in i...
Problem Given an integer array nums, return the maximum difference between two successive elements in its sorted form. If the...
Problem Given a string s, return the number of different non-empty palindromic subsequences in s. Since the answer may be ver...
Problem You have planned some train traveling one year in advance. The days of the year in which you will travel are given as...
Problem A game on an undirected graph is played by two players, Mouse and Cat, who alternate turns. The graph is given as fol...
Problem You are given two integer arrays nums1 and nums2 of lengths m and n respectively. nums1 and nums2 represent the digit...
Problem Given the integers zero, one, low, and high, we can construct a string by starting with an empty string, and then at ...
Problem Given a binary tree root and a linked list with head as the first node. Return True if all the elements in the linked...
Problem You are given an array of unique strings words where words[i] is six letters long. One word of words was chosen as a ...
Problem You are given a list of strings of the same length words and a string target. Your task is to form target using the g...
Problem In a special ranking system, each voter gives a rank from highest to lowest to all teams participating in the competi...
Problem Design a Skiplist without using any built-in libraries. A skiplist is a data structure that takes O(log(n)) time to a...
Problem Given an array nums of positive integers. Your task is to select some subset of nums, multiply each element by an int...
Problem You have n boxes labeled from 0 to n - 1. You are given four arrays: status, candies, keys, and containedBoxes where:...
Problem Given an integer array nums and an integer k, find three non-overlapping subarrays of length k with maximum sum and r...
Problem You are given an integer array nums of even length. You have to split the array into two parts nums1 and nums2 such t...
Problem You are given a positive integer n representing the number of nodes in an undirected graph. The nodes are labeled fro...
Problem There is an undirected graph with n nodes, where each node is numbered between 0 and n - 1. You are given a 2D array ...
Problem You are given an integer array values where values[i] represents the value of the iᵗʰ sightseeing spot. Two sightseei...
Problem You are given an integer array nums, an integer array queries, and an integer x. For each queries[i], you need to fin...