226. Invert Binary Tree
Problem Given the root of a binary tree, invert the tree, and return its root. https://leetcode.com/problems/invert-binary-tr...
Problem Given the root of a binary tree, invert the tree, and return its root. https://leetcode.com/problems/invert-binary-tr...
Problem Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follo...
Problem Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any o...
Problem You have intercepted a secret message encoded as a string of numbers. The message is decoded via the following mappin...
Problem Given an integer array nums, return true if any value appears at least twice in the array, and return false if every ...
Problem You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed...
Problem You are given an integer n representing the number of players in a game and a 2D array pick where pick[i] = [xᵢ, yᵢ] ...
Problem Given an m x n board of characters and a list of strings words, return all words on the board. Each word must be cons...
Problem Design a data structure that supports adding new words and finding if a string matches any previously added string. I...
Problem Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the numbe...
Problem A trie (pronounced as “try”) or prefix tree is a tree data structure used to efficiently store and retrieve keys in a...
Problem There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array pr...
Problem You are given 2 positive integers l and r. For any number x, all positive divisors of x except x are called the prope...
Problem Given an m x n grid of characters board and a string word, return true if word exists in the grid. The word can be co...
Problem Given the head of a singly linked list, reverse the list, and return the reversed list. https://leetcode.com/problems...
Problem Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every c...
Problem Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0’s. You must do it in pla...
Problem Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islan...
Problem There is a snake in an n x n matrix grid and can move in four possible directions. Each cell in the grid is identifie...
Problem You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how ...
Problem You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed...
Problem You are given an integer n and a 2D integer array queries. There are n cities numbered from 0 to n - 1. Initially, th...
Problem You are given an integer array coins representing coins of different denominations and an integer amount representing...
Problem Given a positive integer n, write a function that returns the number of set bits in its binary representation (also k...
Problem Reverse bits of a given 32 bits unsigned integer. Note: Note that in some languages, such as Java, there is no unsig...
Problem You are given an integer n and a 2D integer array queries. There are n cities numbered from 0 to n - 1. Initially, th...
Problem There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robo...
Problem Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structu...
Problem You are given an array of non-overlapping intervals intervals where intervals[i] = [startᵢ, endᵢ] represent the start...
Problem Given an array of intervals where intervals[i] = [startᵢ, endᵢ], merge all overlapping intervals, and return an array...
Problem You are given an integer array nums. You are initially positioned at the array’s first index, and each element in the...
Problem Given an m x n matrix, return all elements of the matrix in spiral order. https://leetcode.com/problems/spiral-matrix...