382. Linked List Random Node
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 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 an integer array nums, return the maximum difference between two successive elements in its sorted form. If the...
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 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 In a special ranking system, each voter gives a rank from highest to lowest to all teams participating in the competi...
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...
Problem You are given an integer array nums and an integer target. You want to build an expression out of nums by adding one ...
Problem Given the root of a binary tree, return an array of the largest value in each row of the tree (0-indexed). https://le...
Problem There is an m x n cake that needs to be cut into 1 x 1 pieces. You are given integers m, n, and two arrays: horizont...
Problem There is a special kind of apple tree that grows apples every day for n days. On the iᵗʰ day, the tree grows apples[i...
Problem Given a list of accounts where each element accounts[i] is a list of strings, where the first element accounts[i][0] ...
Problem You are given the root of a binary tree with unique values. In one operation, you can choose any two nodes at the sam...
Problem There is an exam room with n seats in a single row labeled from 0 to n - 1. When a student enters the room, they must...
Problem In this problem, a tree is an undirected graph that is connected and has no cycles. You are given a graph that starte...
Problem The power of an integer x is defined as the number of steps needed to transform x into 1 using the following steps: ...
Problem Given an integer n, return all the structurally unique BST’s (binary search trees), which has exactly n nodes of uniq...
Problem There is a class with m students and n exams. You are given a 0-indexed m x n integer matrix score, where each row re...
Problem Given an integer n, return the number of structurally unique BST’s (binary search trees) which has exactly n nodes of...
Problem An n-bit gray code sequence is a sequence of 2ⁿ integers where: Every integer is in the inclusive range [0, 2ⁿ - 1],...
Problem Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. You ha...
Problem Implement pow(x, n), which calculates x raised to the power n (i.e., xⁿ). https://leetcode.com/problems/powx-n/ Examp...
Problem Given a string s which represents an expression, evaluate this expression and return its value. The integer division ...
Problem Given the root of a perfect binary tree, reverse the node values at each odd level of the tree. For example, suppose...
Problem You are given a string s, which is known to be a concatenation of anagrams of some string t. Return the minimum possi...
Problem The thief has found himself a new place for his thievery again. There is only one entrance to this area, called root....
Problem Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also repre...
Problem You are given an integer array arr of length n that represents a permutation of the integers in the range [0, n - 1]....
Problem You are given an array prices where prices[i] is the price of a given stock on the iᵗʰ day, and an integer fee repres...