729. My Calendar I
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 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 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...