1603. Design Parking System
Design a parking system for a parking lot. The parking lot has three kinds of parking spaces: big, medium, and...
1547. Minimum Cost to Cut a Stick
Given a wooden stick of length n units. The stick is labelled from 0 to n. For example, a stick...
1406. Stone Game III
Alice and Bob continue their games with piles of stones. There are several stones arranged in a row, and each...
1140. Stone Game II
Alice and Bob continue their games with piles of stones. There are a number of piles arranged in a row,...
837. New 21 Game
Alice plays the following game, loosely based on the card game “21”. Alice starts with 0 points and draws numbers...
2542. Maximum Subsequence Score
You are given two 0-indexed integer arrays nums1 and nums2 of equal length n and a positive integer k. You...
703. Kth Largest Element in a Stream
Design a class to find the kth largest element in a stream. Note that it is the kth largest element...
347. Top K Frequent Elements
Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer...
934. Shortest Bridge
You are given an n x n binary matrix grid where 1 represents land and 0 represents water. An island...
399. Evaluate Division
You are given an array of variable pairs equations and an array of real numbers values, where equations[i] = [Ai,...
785. Is Graph Bipartite?
There is an undirected graph with n nodes, where each node is numbered between 0 and n - 1. You...
1557. Minimum Number of Vertices to Reach All Nodes
Given a directed acyclic graph, with n vertices numbered from 0 to n-1, and an array edges where edges[i] =...
2130. Maximum Twin Sum of a Linked List
In a linked list of size n, where n is even, the ith node (0-indexed) of the linked list is...
24. Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying...
1721. Swapping Nodes in a Linked List
You are given the head of a linked list, and an integer k. Return the head of the linked list...
1799. Maximize Score After N Operations
You are given nums, an array of positive integers of size 2 * n. You must perform n operations on...
2466. Count Ways To Build Good Strings
Given the integers zero, one, low, and high, we can construct a string by starting with an empty string, and...
2140. Solving Questions With Brainpower
You are given a 0-indexed 2D integer array questions where questions[i] = [pointsi, brainpoweri]. The array describes the questions of...
1035. Uncrossed Lines
You are given two integer arrays nums1 and nums2. We write the integers of nums1 and nums2 (in the order...
59. Spiral Matrix II
Given a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral...
54. Spiral Matrix
Given an m x n matrix, return all elements of the matrix in spiral order. Example Input: matrix = [...
1572. Matrix Diagonal Sum
Given a square matrix mat, return the sum of the matrix diagonals. Only include the sum of all the elements...
1964. Find the Longest Valid Obstacle Course at Each Position
You want to build some obstacle courses. You are given a 0-indexed integer array obstacles of length n, where obstacles[i]...
1498. Number of Subsequences That Satisfy the Given Sum Condition
You are given an array of integers nums and an integer target. Return the number of non-empty subsequences of nums...
1456. Maximum Number of Vowels in a Substring of Given Length
Given a string s and an integer k, return the maximum number of vowel letters in any substring of s...
649. Dota2 Senate
In the world of Dota2, there are two parties: the Radiant and the Dire. The Dota2 senate consists of senators...
2215. Find the Difference of Two Arrays
Given two 0-indexed integer arrays nums1 and nums2, return a list answer of size 2 where: answer[0] is a list...
1822. Sign of the Product of an Array
There is a function signFunc(x) that returns: 1 if x is positive. -1 if x is negative. 0 if x...
1491. Average Salary Excluding the Minimum and Maximum Salary
You are given an array of unique integers salary where salary[i] is the salary of the ith employee. Return the...
1579. Remove Max Number of Edges to Keep Graph Fully Traversable
Alice and Bob have an undirected graph of n nodes and three types of edges: Type 1: Can be traversed...