Category Git

What is the Difference Between Git Pull and Git Fetch

Short answers to the question what is the difference between...

How to Revert a Git Repository to a Previous Commit

Short answers to the question how to revert a git...

How to Modify Existing Unpushed Commit Messages

Short answers to the question how to modify existing unpushed...

How to Undo a Git Add Before Commit

Short answers to the question how to undo a git...

How to Rename a Local Git Branch

Short answers to the question how to rename a local...

How to Delete a Git Branch Locally and Remotely

Short answers to the question how to delete a git...

How to Checkout a Remote Git Branch

Short answers to the question how to checkout a remote...

How to Undo the Most Recent Local Commit in Git

Short answers to the question how to undo the most...

Category MySQL

How To Specify Unique Constraint For Multiple Columns In MySQL

How to make multiple columns unique (together) in an existing...

How To Select One Row Per ID With Max Value On A Column

Suppose we have the following REIMBURSEMENT table, find the max...

How To Get The Size Of A Table In MySQL

How to get the size of a table in MySQL...

How To Get The Size Of A Database In MySQL

How to get the size of a database in MySQL...

How To Concatenate Multiple Rows Into One Field In MySQL

How to concatenate multiple rows into one field in MySQL...

How To Change The Data Type Of A Column In MySQL

Given a table EMPLOYEE, change the data type of the...

How To Set A Default Value For A MySQL Datetime Column

How to set a default value for a MySQL Datetime...

How To Output MySQL Query Results In CSV Format

This query writes results into a CSV file on the...

How To Get A List Of User Accounts In MySQL

MySQL stores the user information in its own database.

How To Find Duplicate Values In MySQL

Do a SELECT with a GROUP BY clause.

MySQL INNER JOIN Clause

The INNER JOIN keyword selects records that have matching values...

MySQL Aliases

Aliases are nicknames. They give us a shorthand way of...

MySQL OR Operator

The OR operator combines two Boolean expressions and returns true...

MySQL LIMIT Operator

The LIMIT clause is used in the SELECT statement to...

MySQL LIKE Operator

The LIKE operator is used in a WHERE clause to...

MySQL IS NULL Operator

To test whether a value is NULL or not, we...

MySQL IN Clause

The IN operator allows us to determine if a specified...

MySQL BETWEEN Operator

The BETWEEN operator selects values within a given range.

MySQL AND Operator

The AND operator is a logical operator that combines two...

MySQL WHERE Clause

The WHERE clause allows us to choose which rows are...

MySQL DISTINCT Clause

In order to remove duplicate rows, we use the DISTINCT...

MySQL ORDER BY Clause

The ORDER BY clause is used to sort the result-set...

MySQL SELECT Statement

The SELECT statement allows us to read data from one...

Category Database

Users That Actively Request Confirmation Messages Problem

LeetCode 1939. Write an SQL query to find the IDs...

Strong Friendship Problem

LeetCode 1949. Write an SQL query to find all the...

Leetcodify Similar Friends Problem

LeetCode 1919. Write an SQL query to report the similar...

Leetcodify Friends Recommendations Problem

LeetCode 1917. Write an SQL query to recommend friends to...

First and Last Call On the Same Day Problem

LeetCode 1972. Write an SQL query to report the IDs...

Find Cutoff Score for Each School Problem

LeetCode 1988. Write an SQL query to report the minimum...

Employees With Missing Information Problem

LeetCode 1965. Write an SQL query to report the IDs...

Employees Whose Manager Left the Company Problem

LeetCode 1978. Write an SQL query to report the IDs...

Count the Number of Experiments Problem

LeetCode 1990. Write an SQL query to report the number...

Count Salary Categories Problem

LeetCode 1907. Write an SQL query to report the number...

Confirmation Rate Problem

LeetCode 1934. Write an SQL query to find the confirmation...

All the Pairs With the Maximum Number of Common Followers Problem

LeetCode 1951. Write an SQL query to find all the...

The Latest Login in 2020 Problem

LeetCode 1890. Write an SQL query to report the latest...

Suspicious Bank Accounts Problem

LeetCode 1843. Write an SQL query to report the IDs...

Page Recommendations II Problem

LeetCode 1892. Write an SQL query to find all the...

Orders With Maximum Quantity Above Average Problem

LeetCode 1867. Write an SQL query to find the order_id...

Maximum Transaction Each Day Problem

LeetCode 1831. Write an SQL query to report the IDs...

League Statistics Problem

LeetCode 1841. Write an SQL query to report the statistics...

Group Employees of the Same Salary Problem

LeetCode 1875. Write an SQL query to report the IDs...

Find Customers With Positive Revenue this Year Problem

LeetCode 1821. Write an SQL query to report the customers...

Convert Date Format Problem

LeetCode 1853. Write an SQL query to convert each date...

Calculate Special Bonus Problem

LeetCode 1873. Write an SQL query to calculate the bonus...

Rearrange Products Table Problem

LeetCode 1795. Write an SQL query to rearrange the Products...

Find Interview Candidates Problem

LeetCode 1811. Write an SQL query to report the name...

Ad-Free Sessions Problem

LeetCode 1809. Write an SQL query to report all the...

Primary Department For Each Employee Problem

LeetCode 1789. Write an SQL query to report all the...

Grand Slam Titles Problem

LeetCode 1783. Write an SQL query to report the number...

Product's Price For Each Store Problem

LeetCode 1777. Write an SQL query to find the price...

Find The Subtasks That Did Not Execute Problem

LeetCode 1767. Write an SQL query to report the IDs...

Recyclable And Low Fat Products Problem

LeetCode 1757. Write an SQL query to find the ids...

Leetflex Banned Accounts Problem

LeetCode 1747. Write an SQL query to find the account_id...

Find Total Time Spent By Each Employee Problem

LeetCode 1741. Write an SQL query to calculate the total...

The Number Of Employees Which Report To Each Employee Problem

LeetCode 1731. Write an SQL query to report the ids...

Find Followers Count Problem

LeetCode 1729. Write an SQL query that will, for each...

Count Apples And Oranges Problem

LeetCode 1715. Write an SQL query to count the number...

Biggest Window Between Visits Problem

LeetCode 1709. Write an SQL query that will, for each...

Total Sales Amount By Year Problem

LeetCode 1384. Write an SQL query to report the Total...

Sales By Day Of The Week Problem

LeetCode 1479. Write an SQL query to report how many...

Hopper Company Queries III Problem

LeetCode 1651. Write an SQL query to compute the average_ride_distance...

Get The Second Most Recent Activity Problem

LeetCode 1369. Write an SQL query to show the second...

Find The Quiet Students In All Exams Problem

LeetCode 1412. Write an SQL query to report the students...

Tournament Winners Problem

LeetCode 1194. Write an SQL query to find the winner...

Students Report By Geography Problem

LeetCode 618. A U.S graduate school has students from Asia,...

Report Contiguous Dates Problem

LeetCode 1225. Write an SQL query to generate a report...

Median Employee Salary Problem

LeetCode 569. Write a SQL query to find the median...

Market Analysis II Problem

LeetCode 1159. Write an SQL query to find for each...

Hopper Company Queries I Problem

LeetCode 1635. Write an SQL query to report the following...

Game Play Analysis V Problem

LeetCode 1097. Write an SQL query that reports for each...

User Purchase Platform Problem

LeetCode 1127. Write an SQL query to find the total...

Trips And Users Problem

LeetCode 262. Write a SQL query to find the cancellation...

Number Of Transactions Per Visit Problem

LeetCode 1336. Write an SQL query to find how many...

Human Traffic Of Stadium Problem

LeetCode 601. Write an SQL query to display the records...

Hopper Company Queries II Problem

LeetCode 1645. Write an SQL query to report the percentage...

Find Median Given Frequency Of Numbers Problem

LeetCode 571. Write a query to find the median of...

Find Cumulative Salary Of An Employee Problem

LeetCode 579. Write a SQL to get the cumulative sum...

Department Top Three Salaries Problem

LeetCode 185. Write a SQL query to find employees who...

Average Salary: Departments VS Company Problem

LeetCode 615. Given two tables as below, write a query...

Unpopular Books Problem

LeetCode 1098. Write an SQL query that reports the books...

Second Degree Follower Problem

LeetCode 614. Please write a sql query to get the...

Reported Posts II Problem

LeetCode 1132. Write an SQL query to find the average...

Number Of Calls Between Two Persons Problem

LeetCode 1699. Write an SQL query to report the number...

Nth Highest Salary Problem

LeetCode 177. Write a SQL query to get the nth...

New Users Daily Count Problem

LeetCode 1107. Write an SQL query that reports for every...

Monthly Transactions II Problem

LeetCode 1205. Write an SQL query to find for each...

Get Highest Answer Rate Question Problem

LeetCode 578. Write a sql query to identify the question...

Department Highest Salary Problem

LeetCode 184. Write a SQL query to find employees who...

Article Views II Problem

LeetCode 1149. Write an SQL query to find all the...

Active Users Problem

LeetCode 1454. Write an SQL query to find the id...

Winning Candidate Problem

LeetCode 574. Write a sql to find the name of...

Team Scores In Football Tournament Problem

LeetCode 1212. Write an SQL query that selects the team_id,...

Rank Scores Problem

LeetCode 178. Write a SQL query to rank scores. If...

Product Sales Analysis III Problem

LeetCode 1070. Write an SQL query that selects the product...

Movie Rating Problem

LeetCode 1341. Write the following SQL query to find the...

Investments In 2016 Problem

LeetCode 585. Write a query to print the sum of...

Immediate Food Delivery II Problem

LeetCode 1174. Write an SQL query to find the percentage...

Friend Requests II: Who Has The Most Friends Problem

LeetCode 602. In social network like Facebook or Twitter, people...

Countries You Can Safely Invest In Problem

LeetCode 1501. Write an SQL query to find the countries...

Count Student Number In Departments Problem

LeetCode 580. A university uses 2 data tables, student and...

Bank Account Summary Problem

LeetCode 1555. Our bank records all transactions in the table...

Tree Node Problem

LeetCode 608. Given a table tree, id is identifier of...

The Most Recent Orders For Each Product Problem

LeetCode 1549. Write an SQL query to find the most...

Shortest Distance In A Plane Problem

LeetCode 612. Write a query to find the shortest distance...

Rectangles Area Problem

LeetCode 1459. Write an SQL query to report of all...

Product Price At A Given Date Problem

LeetCode 1164. Write an SQL query to find the prices...

Page Recommendations Problem

LeetCode 1264. Write an SQL query to recommend pages to...

Monthly Transactions I Problem

LeetCode 1193. Write an SQL query to find for each...

Market Analysis I Problem

LeetCode 1158. Write an SQL query to find for each...

Managers With At Least 5 Direct Reports Problem

LeetCode 570. Given the Employee table, write a SQL query...

Find The Missing IDs Problem

LeetCode 1613. Write an SQL query to find the missing...

Exchange Seats Problem

LeetCode 626. Mary is a teacher in a middle school...

Customers Who Bought All Products Problem

LeetCode 1045. Write an SQL query for a report that...

Active Business Problem

LeetCode 1126. Write an SQL query to find all active...

The Most Recent Three Orders Problem

LeetCode 1532. Write an SQL query to find the most...

Restaurant Growth Problem

LeetCode 1321. You are the restaurant owner and you want...

Project Employees III Problem

LeetCode 1077. Write an SQL query that reports the most...

Number Of Trusted Contacts Of A Customer Problem

LeetCode 1364. Write an SQL query to find the following...

NPV Queries Problem

LeetCode 1421. Write an SQL query to find the npv...

Last Person To Fit In The Elevator Problem

LeetCode 1204. Write an SQL query to find the person_name...

Highest Grade For Each Student Problem

LeetCode 1112. Write a SQL query to find the highest...

Evaluate Boolean Expression Problem

LeetCode 1440. Write an SQL query to evaluate the boolean...

Calculate Salaries Problem

LeetCode 1468. Write an SQL query to find the salaries...

Activity Participants Problem

LeetCode 1355. Write an SQL query to find the names...

User Activity For The Past 30 Days II Problem

LeetCode 1142. Write an SQL query to find the average...

The Most Frequently Ordered Products For Each Customer Problem

LeetCode 1596. Write an SQL query to find the most...

Running Total For Different Genders Problem

LeetCode 1308. Write an SQL query to find the total...

Friendly Movies Streamed Last Month Problem

LeetCode 1495. Write an SQL query to report the distinct...

Friend Requests I: Overall Acceptance Rate Problem

LeetCode 597. Write an SQL query to find the overall...

Find The Start And End Number Of Continuous Ranges Problem

LeetCode 1285. Write an SQL query to find the start...

Customers Who Bought Products A And B But Not C Problem

LeetCode 1398. Write an SQL query to report the customer_id...

Classes More Than 5 Students Problem

LeetCode 596. Please list out all classes which have more...

Capital Gain/Loss Problem

LeetCode 1393. Write an SQL query to report the Capital...

Biggest Single Number Problem

LeetCode 619. Table my_numbers contains many numbers in column num...

Apples & Oranges Problem

LeetCode 1445. Write an SQL query to report the difference...

All People Report To The Given Manager Problem

LeetCode 1270. Write an SQL query to find employee_id of...

Weather Type In Each Country Problem

LeetCode 1294. Write an SQL query to find the type...

User Activity For The Past 30 Days I Problem

LeetCode 1141. Write an SQL query to find the daily...

Triangle Judgement Problem

LeetCode 610. A pupil Tim gets homework to identify whether...

Students And Examinations Problem

LeetCode 1280. Write an SQL query to find the number...

Sales Person Problem

LeetCode 607. Given three tables, salesperson, company, orders.

Sales Analysis III Problem

LeetCode 1084. Write an SQL query that reports the products...

Sales Analysis II Problem

LeetCode 1083. Write an SQL query that reports the buyers...

Reported Posts Problem

LeetCode 1113. Write an SQL query that reports the number...

Queries Quality And Percentage Problem

LeetCode 1211. Write an SQL query to find each query_name,...

Project Employees II Problem

LeetCode 1076. Write an SQL query that reports all the...

Project Employees I Problem

LeetCode 1075. Write an SQL query that reports the average...

Number Of Comments Per Post Problem

LeetCode 1241. Write an SQL query to find number of...

Not Boring Movies Problem

LeetCode 620. X city opened a new cinema, many people...

Fix Product Name Format Problem

LeetCode 1543. Write an SQL query to report product_name in...

Consecutive Available Seats Problem

LeetCode 603. Several friends at a cinema ticket office would...

Ads Performance Problem

LeetCode 1322. A company is running Ads and wants to...

Top Travellers Problem

LeetCode 1407. Write an SQL query to report the distance...

Swap Salary Problem

LeetCode 627. Given a table salary, such as the one...

Shortest Distance Problem

LeetCode 613. Write a query to find the shortest distance...

Sales Analysis I Problem

LeetCode 1082. Write an SQL query that reports the best...

Reformat Department Table Problem

LeetCode 1179. Write an SQL query to reformat the table...

Product Sales Analysis II Problem

LeetCode 1069. Write an SQL query that reports the total...

Product Sales Analysis I Problem

LeetCode 1068. Write an SQL query that reports all product...

List The Products Ordered In A Period Problem

LeetCode 1327. Write an SQL query to get the names...

Immediate Food Delivery I Problem

LeetCode 1173. Write an SQL query to find the percentage...

Find Users With Valid Emails Problem

LeetCode 1517. Write an SQL query to find the users...

Find Customer Referee Problem

LeetCode 584. Given a table customer holding customers information and...

Customer Placing The Largest Number Of Orders Problem

LeetCode 586. Query the customer_number from the orders table for...

Customer Order Frequency Problem

LeetCode 1511. Write an SQL query to report the customer_id...

Create A Session Bar Chart Problem

LeetCode 1435. You want to know how long a user...

Big Countries Problem

LeetCode 595. Write a SQL solution to output big countries’...

Average Selling Price Problem

LeetCode 1251. Write an SQL query to find the average...

Article Views I Problem

LeetCode 1148. Write an SQL query to find all the...

Actors And Directors Who Cooperated At Least Three Times Problem

LeetCode 1050. Write a SQL query for a report that...

Unique Orders And Customers Per Month Problem

LeetCode 1565. Write an SQL query to find the number...

Sellers With No Sales Problem

LeetCode 1607. Write an SQL query to report the names...

Rising Temperature Problem

LeetCode 197. Write an SQL query to find all dates’...

Game Play Analysis IV Problem

LeetCode 550. Write an SQL query that reports the fraction...

Game Play Analysis III Problem

LeetCode 534. Write an SQL query that reports for each...

Game Play Analysis II Problem

LeetCode 512. Write a SQL query that reports the device...

Game Play Analysis I Problem

LeetCode 511. Write an SQL query that reports the first...

Employee Bonus Problem

LeetCode 577. Select all employee’s name and bonus whose bonus...

Delete Duplicate Emails Problem

LeetCode 196. Write a SQL query to delete all duplicate...

Daily Leads And Partners Problem

LeetCode 1693. Write an SQL query that will, for each...

Customer Who Visited But Did Not Make Any Transactions Problem

LeetCode 1581. Write an SQL query to find the IDs...

Product's Worth Over Invoices Problem

LeetCode 1677. Write an SQL query that will, for all...

Percentage Of Users Attended A Contest Problem

LeetCode 1633. Write an SQL query to find the percentage...

Fix Names In A Table Problem

LeetCode 1667. Write an SQL query to fix the names...

Duplicate Emails Problem

LeetCode 182. Write a SQL query to find all duplicate...

Customers Who Never Order Problem

LeetCode 183. Write a SQL query to find all customers...

Consecutive Numbers Problem

LeetCode 180. Write an SQL query to find all numbers...

Average Time Of Process Per Machine Problem

LeetCode 1661. There is a factory website that has several...

Second Highest Salary Problem

LeetCode 176. Given the Employee table, write a SQL query...

Employees Earning More Than Their Managers Problem

LeetCode 181. Given the Employee table, write a SQL query...

Bank Account Summary II Problem

LeetCode 1587. Write an SQL query to report the name...

Group Sold Products By The Date Problem

LeetCode 1484. Write an SQL query to find for each...

All Valid Triplets That Can Represent A Country Problem

LeetCode 1623. Write an SQL query to find all the...

Warehouse Manager Problem

LeetCode 1571. Write an SQL query to report how much...

Students With Invalid Departments Problem

LeetCode 1350. Write an SQL query to find the id...

Replace Employee ID With The Unique Identifier Problem

LeetCode 1378. Write an SQL query to show the unique...

Patients With A Condition Problem

LeetCode 1527. Write an SQL query to report the patient_id,...

Invalid Tweets Problem

LeetCode 1683. Write an SQL query to find the IDs...

Find The Team Size Problem

LeetCode 1303. Write an SQL query to find the team...

Combine Two Tables Problem

LeetCode 175. Write a SQL query for a report that...

Category List

Git Short Answers List

A growing list of Git questions and short answers.

MySQL Tutorial List

A growing list of MySQL tutorials.

LeetCode Database Solution List

A list of LeetCode database problems and solutions.

LeetCode Solution List

A growing list of LeetCode problems and solutions.

Operating System Topic List

A growing list of posts under the topic of Operating...

Object Oriented Design Topic List

A growing list of posts under the topic of Object...

C++ Concept List

A growing list of posts under the topic of C++...

Category Operating System

Concurrency II: Introduction Cont'd

Another important question is how threads interact when they access...

Concurrency I: Introduction

A thread is an abstraction for a single running process....

Process I: The Abstraction

How can the OS provide the illusion of nearly-endless supply...

Virtual Memory VIII: Page Replacement Policies

How can the OS decide which page(s) to evict from...

Virtual Memory VII: Page Replacement Mechanisms

How can the OS make use of a larger, slower...

Virtual Memory VI: Smaller Tables

How can we make page tables smaller.

Virtual Memory V: TLBs

How can we speed up address translation, and generally avoid...

Virtual Memory IV: Paging

How can we virtualize memory with pages, so as to...

Virtual Memory III: Segmentation

How to support a large address space with (potentially) a...

Virtual Memory II: Address Translation

How can we relocate the process in memory in a...

Virtual Memory I: Overview

Virtual Memory is an abstraction that the Operating System provides...

Category Object-Oriented Design

Online Book Reader System Problem

Design the data structures for an online book reader system...

Parking Lot Problem

Design a parking lot using object-oriented principles. We will focus...

Call Center Problem

An object oriented design problem. Imagine you have a call...

Category Design Pattern

Singleton Design Pattern

The singleton design pattern is a type of creational pattern...

Factory Design Pattern

The factory design pattern is a type of creational pattern...

Category C++ Concepts

Value Categories in C++

Every C++ expression has a type and belongs to a...

Rvalue References in C++: Perfect Forwarding

Perfect forwarding reduces the need for overloaded functions and helps...

Rvalue References in C++: Move Semantics

The rvalue references enable us to distinguish an lvalue from...

References in C++

A reference is an alias of another object. It stores...

Lvalue References in C++

An lvalue reference is another name of an object. An...

Lambda Expressions in C++

A lambda expression is a convenient way of defining an...

Template Specializations in C++

A template specialization is a separate definition in which the...

Implicit Type Conversions in C++

C++ transforms the operands to a common type before performing...

Explicit Type Conversions in C++

An explicit conversion is also called as a cast. There...

Copy Constructors in C++

The constructor that takes a single parameter that is a...

Inline Functions in C++

A function specified as inline is expanded everywhere it is...

Function Pointers in C++

A function pointer is a pointer that denotes a function...

Weak_Ptr in C++

Sometimes an object must store a way to access the...

Friend Class and Function in C++

A friend class can access private and protected members of...

Unique_Ptr in C++

A unique_ptr does not share its pointer. It cannot be...

Smart Pointers in C++

In modern C++ programming, the Standard Library includes smart pointers,...

Shared_Ptr in C++

The shared_ptr type is a smart pointer that is designed...

Templates in C++

A template is a blueprint or formula for creating a...

Polymorphism in C++

Polymorphism means having more than one function with the same...

Interfaces in C++

An interface describes the behavior or capabilities of a C++...

Category Data Structure

X Of A Kind In A Deck Of Cards Problem

LeetCode 914. In a deck of cards, each card has...

Word Subsets Problem

LeetCode 916. You are given two string arrays words1 and...

Walking Robot Simulation Problem

LeetCode 874. A robot on an infinite XY-plane starts at...

Vertical Order Traversal Of A Binary Tree Problem

LeetCode 987. Given the root of a binary tree, calculate...

Validate Stack Sequences Problem

LeetCode 946. Given two integer arrays pushed and popped each...

Valid Permutations For DI Sequence Problem

LeetCode 903. You are given a string s of length...

Valid Mountain Array Problem

LeetCode 941. Given an array of integers arr, return true...

Univalued Binary Tree Problem

LeetCode 965. A binary tree is uni-valued if every node...

Unique Paths III Problem

LeetCode 980. You are given an m x n integer...

Unique Morse Code Words Problem

LeetCode 804. International Morse Code defines a standard encoding where...

Unique Email Addresses Problem

LeetCode 929. Every valid email consists of a local name...

Uncommon Words From Two Sentences Problem

LeetCode 884. A sentence is a string of single-space separated...

Triples With Bitwise And Equal To Zero Problem

LeetCode 982. Given an integer array nums, return the number...

Transpose Matrix Problem

LeetCode 867. Given a 2D integer array matrix, return the...

Time Based Key-Value Store Problem

LeetCode 981. Design a time-based key-value data structure that can...

Three Equal Parts Problem

LeetCode 927. You are given an array arr which consists...

Tallest Billboard Problem

LeetCode 956. You are installing a billboard and want it...

Surface Area Of 3D Shapes Problem

LeetCode 892. You are given an n x n grid...

Super Egg Drop Problem

LeetCode 887. You are given k identical eggs and you...

Sum Of Subsequence Widths Problem

LeetCode 891. The width of a sequence is the difference...

Sum Of Subarray Minimums Problem

LeetCode 907. Given an array of integers arr, find the...

Sum Of Even Numbers After Queries Problem

LeetCode 985. You are given an integer array nums and...

Sum Of Distances In Tree Problem

LeetCode 834. There is an undirected connected tree with n...

Subdomain Visit Count Problem

LeetCode 811. A website domain “discuss.leetcode.com” consists of various subdomains....

Subarrays With K Different Integers Problem

LeetCode 992. Given an integer array nums and an integer...

String Without Aaa Or Bbb Problem

LeetCode 984. Given two integers a and b, return any...

Stone Game Problem

LeetCode 877. Alice and Bob play a game with piles...

Stamping The Sequence Problem

LeetCode 936. You are given two strings stamp and target....

Squares Of A Sorted Array Problem

LeetCode 977. Given an integer array nums sorted in non-decreasing...

Split Array With Same Average Problem

LeetCode 805. You are given an integer array nums.

Split Array Into Fibonacci Sequence Problem

LeetCode 842. You are given a string of digits num,...

Soup Servings Problem

LeetCode 808. There are two types of soup, type A...

Sort Array By Parity Problem

LeetCode 905. Given an integer array nums, move all the...

Sort Array By Parity II Problem

LeetCode 922. Given an array of integers nums, half of...

Sort An Array Problem

LeetCode 912. Given an array of integers nums, sort the...

Snakes And Ladders Problem

LeetCode 909. You are given an n x n integer...

Smallest Subtree With All The Deepest Nodes Problem

LeetCode 865. Given the root of a binary tree, the...

Smallest String Starting From Leaf Problem

LeetCode 988. You are given the root of a binary...

Smallest Range I Problem

LeetCode 908. You are given an integer array nums and...

Similar String Groups Problem

LeetCode 839. Two strings Xand Yare similar if we can...

Shortest Subarray With Sum At Least K Problem

LeetCode 862. Given an integer array nums and an integer...

Shortest Path Visiting All Nodes Problem

LeetCode 847. You have an undirected, connected graph of n...

Shortest Path To Get All Keys Problem

LeetCode 864. You are given an m x n grid...

Shortest Distance To A Character Problem

LeetCode 821. Given a string s and a character c...

Shortest Bridge Problem

LeetCode 934. You are given an n x n binary...

Short Encoding Of Words Problem

LeetCode 820. A valid encoding of an array of words...

Shifting Letters Problem

LeetCode 848. You are given a string s of lowercase...

Score Of Parentheses Problem

LeetCode 856. Given a balanced parentheses string s, return the...

Score After Flipping Matrix Problem

LeetCode 861. You are given an m x n binary...

Satisfiability Of Equality Equations Problem

LeetCode 990. You are given an array of strings equations...

Rotting Oranges Problem

LeetCode 994. You are given an m x n grid...

Rle Iterator Problem

LeetCode 900. We can use run-length encoding (i.e., RLE) to...

Reverse Only Letters Problem

LeetCode 917. Given a string s, reverse the string according...

Reveal Cards In Increasing Order Problem

LeetCode 950. You are given an integer array deck. There...

Reordered Power Of 2 Problem

LeetCode 869. You are given an integer n. We reorder...

Reorder Data In Log Files Problem

LeetCode 937. You are given an array of logs. Each...

Regions Cut By Slashes Problem

LeetCode 959. An n x n grid is composed of...

Rectangle Overlap Problem

LeetCode 836. An axis-aligned rectangle is represented as a list...

Reachable Nodes In Subdivided Graph Problem

LeetCode 882. You are given an undirected graph (the “original...

Range Sum Of BST Problem

LeetCode 938. Given the root node of a binary search...

Race Car Problem

LeetCode 818. Your car starts at position 0 and speed...

Projection Area Of 3D Shapes Problem

LeetCode 883. You are given an n x n grid...

Profitable Schemes Problem

LeetCode 879. There is a group of n members, and...

Prison Cells After N Days Problem

LeetCode 957. There are 8 prison cells in a row...

Prime Palindrome Problem

LeetCode 866. Given an integer n, return the smallest prime...

Powerful Integers Problem

LeetCode 970. Given three integers x, y, and bound, return...

Possible Bipartition Problem

LeetCode 886. We want to split a group of n...

Positions Of Large Groups Problem

LeetCode 830. In a string sof lowercase letters, these letters...

Peak Index In A Mountain Array Problem

LeetCode 852. Let’s call an array arr a mountainif the...

Partition Array Into Disjoint Intervals Problem

LeetCode 915. Given an integer array nums, partition it into...

Pancake Sorting Problem

LeetCode 969. Given an array of integers arr, sort the...

Orderly Queue Problem

LeetCode 899. You are given a string s and an...

Online Stock Span Problem

LeetCode 901. Design an algorithm that collects daily price quotes...

Online Election Problem

LeetCode 911. You are given two integer arrays persons and...

Odd Even Jump Problem

LeetCode 975. You are given an integer array arr. From...

Numbers With Same Consecutive Differences Problem

LeetCode 967. Return all non-negative integers of length n such...

Numbers At Most N Given Digit Set Problem

LeetCode 902. Given an array of digits which is sorted...

Number Of Recent Calls Problem

LeetCode 933. You have a RecentCounter class which counts the...

Number Of Music Playlists Problem

LeetCode 920. Your music player contains n different songs. You...

Number Of Lines To Write String Problem

LeetCode 806. You are given a string s of lowercase...

Nth Magical Number Problem

LeetCode 878. A positive integer is magical if it is...

New 21 Game Problem

LeetCode 837. Alice plays the following game, loosely based on...

Most Stones Removed With Same Row Or Column Problem

LeetCode 947. On a 2D plane, we place n stones...

Most Profit Assigning Work Problem

LeetCode 826. You have n jobs and m workers. You...

Most Common Word Problem

LeetCode 819. Given a string paragraph and a string array...

Monotonic Array Problem

LeetCode 896. An array is monotonic if it is either...

Mirror Reflection Problem

LeetCode 858. There is a special square room with mirrors...

Minimum Swaps To Make Sequences Increasing Problem

LeetCode 801. You are given two integer arrays of the...

Minimum Number Of K Consecutive Bit Flips Problem

LeetCode 995. You are given a binary array nums and...

Minimum Increment To Make Array Unique Problem

LeetCode 945. You are given an integer array nums. In...

Minimum Falling Path Sum Problem

LeetCode 931. Given an n x n array of integers...

Minimum Cost To Merge Stones Problem

LeetCode 1000. There are n piles of stones arranged in...

Minimum Cost To Hire K Workers Problem

LeetCode 857. There are n workers. You are given two...

Minimum Cost For Tickets Problem

LeetCode 983. You have planned some train traveling one year...

Minimum Area Rectangle Problem

LeetCode 939. You are given an array of points in...

Minimum Add To Make Parentheses Valid Problem

LeetCode 921. A parentheses string is valid if and only...

Minimize Malware Spread Problem

LeetCode 924. You are given a network of n nodes...

Minimize Malware Spread II Problem

LeetCode 928. You are given a network of n nodes...

Middle Of The Linked List Problem

LeetCode 876. Given the head of a singly linked list,...

Maximum Width Ramp Problem

LeetCode 962. A ramp in an integer array nums is...

Maximum Sum Circular Subarray Problem

LeetCode 918. Given a circular integer array nums of length...

Maximum Frequency Stack Problem

LeetCode 895. Design a stack-like data structure to push elements...

Maximum Binary Tree II Problem

LeetCode 998. A maximum tree is a tree where every...

Maximize Distance To Closest Person Problem

LeetCode 849. You are given an array representing a row...

Max Increase To Keep City Skyline Problem

LeetCode 807. There is a city composed of n x...

Masking Personal Information Problem

LeetCode 831. You are given a personal information string s,...

Making A Large Island Problem

LeetCode 827. You are given an n x n binary...

Magic Squares In Grid Problem

LeetCode 840. A 3 x 3 magic square is a...

Loud And Rich Problem

LeetCode 851. There is a group of n people labeled...

Longest Turbulent Subarray Problem

LeetCode 978. Given an integer array arr, return the length...

Longest Mountain In Array Problem

LeetCode 845. Given an integer array arr, return the length...

Long Pressed Name Problem

LeetCode 925. Your friend is typing his name into a...

Linked List Components Problem

LeetCode 817. You are given the head of a linked...

Length Of Longest Fibonacci Subsequence Problem

LeetCode 873. Given a strictly increasing array arr of positive...

Least Operators To Express Number Problem

LeetCode 964. Given a single positive integer x, we will...

Leaf-Similar Trees Problem

LeetCode 872. Consider all the leaves of a binary tree,...

Largest Triangle Area Problem

LeetCode 812. Given an array of points on the X-Y...

Largest Time For Given Digits Problem

LeetCode 949. Given an arrayarr of 4 digits, find the...

Largest Sum Of Averages Problem

LeetCode 813. You are given an integer array nums and...

Largest Perimeter Triangle Problem

LeetCode 976. Given an integer array nums, return the largest...

K-Similar Strings Problem

LeetCode 854. Strings s1 and s2 are k-similar (for some...

K Closest Points To Origin Problem

LeetCode 973. Given an array of points where points[i] =...

Increasing Order Search Tree Problem

LeetCode 897. Given the root of a binary search tree,...

Hand Of Straights Problem

LeetCode 846. Alice has some number of cards and she...

Groups Of Special-Equivalent Strings Problem

LeetCode 893. You are given an array of strings of...

Fruit Into Baskets Problem

LeetCode 904. You are visiting a farm that has a...

Flip String To Monotone Increasing Problem

LeetCode 926. A binary string is monotone increasing if it...

Flip Equivalent Binary Trees Problem

LeetCode 951. For a binary tree T, we can define...

Flip Binary Tree To Match Preorder Traversal Problem

LeetCode 971. You are given the root of a binary...

Find The Shortest Superstring Problem

LeetCode 943. Given an array of strings words, return the...

Find And Replace Pattern Problem

LeetCode 890. Given a list of strings words and a...

Equal Rational Numbers Problem

LeetCode 972. Given two strings s and t, each of...

Delete Columns To Make Sorted Problem

LeetCode 944. You are given an array of n strings...

Delete Columns To Make Sorted III Problem

LeetCode 960. You are given an array of n strings...

Delete Columns To Make Sorted II Problem

LeetCode 955. You are given an array of n strings...

Decoded String At Index Problem

LeetCode 880. You are given an encoded string s. To...

Cousins In Binary Tree Problem

LeetCode 993. Given the root of a binary tree with...

Count Unique Characters Of All Substrings Of A Given String Problem

LeetCode 828. Let’s define a function countUniqueChars(s) that returns the...

Construct Binary Tree From Preorder And Postorder Traversal Problem

LeetCode 889. Given two integer arrays, preorder and postorder where...

Consecutive Numbers Sum Problem

LeetCode 829. Given an integer n, return the number of...

Complete Binary Tree Inserter Problem

LeetCode 919. A complete binary tree is a binary tree...

Check Completeness Of A Binary Tree Problem

LeetCode 958. Given the root of a binary tree, determine...

Chalkboard Xor Game Problem

LeetCode 810. You are given an array of integers nums...

Cat And Mouse Problem

LeetCode 913. A game on an undirected graph is played...

Card Flipping Game Problem

LeetCode 822. You are given n cards, with a positive...

Car Fleet Problem

LeetCode 853. There are n cars going to the same...

Bus Routes Problem

LeetCode 815. You are given an array routes representing bus...

Buddy Strings Problem

LeetCode 859. Given two strings s and goal, return true...

Broken Calculator Problem

LeetCode 991. There is a broken calculator that has the...

Bricks Falling When Hit Problem

LeetCode 803. You are given an m x n binary...

Boats To Save People Problem

LeetCode 881. You are given an array people where people[i]...

Bitwise ORs Of Subarrays Problem

LeetCode 898. We have an array arr of non-negative integers....

Binary Trees With Factors Problem

LeetCode 823. Given an array of unique integers, arr, where...

Binary Tree Pruning Problem

LeetCode 814. Given the root of a binary tree, return...

Binary Tree Cameras Problem

LeetCode 968. You are given the root of a binary...

Binary Subarrays With Sum Problem

LeetCode 930. Given a binary array nums and an integer...

Binary Gap Problem

LeetCode 868. Given a positive integer n, find and return...

Beautiful Array Problem

LeetCode 932. Given the integer n, return any beautiful array...

Bag Of Tokens Problem

LeetCode 948. You have an initial power of power, an...

Backspace String Compare Problem

LeetCode 844. Given two strings s and t, return true...

Available Captures For Rook Problem

LeetCode 999. On an 8 x 8 chessboard, there is...

Array Of Doubled Pairs Problem

LeetCode 954. Given an integer array of even length arr,...

Ambiguous Coordinates Problem

LeetCode 816. We had some 2-dimensional coordinates, like “(1, 3)”...

All Possible Full Binary Trees Problem

LeetCode 894. Given an integer n, return a list of...

All Nodes Distance K In Binary Tree Problem

LeetCode 863. Given the root of a binary tree, the...

Advantage Shuffle Problem

LeetCode 870. You are given two integer arrays nums1 and...

Add To Array-Form Of Integer Problem

LeetCode 989. The array-form of an integer num is an...

3Sum With Multiplicity Problem

LeetCode 923. Given an integer array arr, and an integer...

Valid Triangle Number Problem

LeetCode 611. Given an integer array nums, return the number...

Valid Tic-Tac-Toe State Problem

LeetCode 794. Given a Tic-Tac-Toe board as a string array...

Valid Parenthesis String Problem

LeetCode 678. Given a string s containing only three types...

Valid Palindrome II Problem

LeetCode 680. Given a string s, return true if the...

Transform To Chessboard Problem

LeetCode 782. You are given an n x n binary...

Top K Frequent Words Problem

LeetCode 692. Given an array of strings words and an...

Toeplitz Matrix Problem

LeetCode 766. Given an m x n matrix, returntrueif the...

Task Scheduler Problem

LeetCode 621. Given a characters array tasks, representing the tasks...

Swim In Rising Water Problem

LeetCode 778. You are given an n x n integer...

Swap Adjacent In LR String Problem

LeetCode 777. In a string composed of ‘L’, ‘R’, and...

Strange Printer Problem

LeetCode 664. There is a strange printer with the following...

Stickers To Spell Word Problem

LeetCode 691. We are given n different types of stickers....

Split Linked List In Parts Problem

LeetCode 725. Given the head of a singly linked list...

Special Binary String Problem

LeetCode 761. Special binary strings are binary strings with the...

Solve The Equation Problem

LeetCode 640. Solve a given equation and return the value...

Sliding Puzzle Problem

LeetCode 773. On an 2 x 3 board, there are...

Shopping Offers Problem

LeetCode 638. In LeetCode Store, there are n items to...

Set Mismatch Problem

LeetCode 645. You have a set of integers s, which...

Set Intersection Size At Least Two Problem

LeetCode 757. You are given a 2D integer array intervals...

Self Dividing Numbers Problem

LeetCode 728. A self-dividing number is a number that is...

Robot Return To Origin Problem

LeetCode 657. There is a robot starting at the position...

Reorganize String Problem

LeetCode 767. Given a string s, rearrange the characters of...

Redundant Connection Problem

LeetCode 684. In this problem, a tree is an undirected...

Redundant Connection II Problem

LeetCode 685. In this problem, a rooted tree is a...

Reaching Points Problem

LeetCode 780. Given four integers sx, sy, tx, and ty,...

Range Module Problem

LeetCode 715. A Range Module is a module that tracks...

Random Pick With Blacklist Problem

LeetCode 710. You are given an integer n and an...

Rabbits In Forest Problem

LeetCode 781. There is a forest with an unknown number...

Pyramid Transition Matrix Problem

LeetCode 756. You are stacking blocks to form a pyramid....

Preimage Size Of Factorial Zeroes Function Problem

LeetCode 793. Let f(x) be the number of zeroes at...

Partition Labels Problem

LeetCode 763. You are given a string s. We want...

Parse Lisp Expression Problem

LeetCode 736. You are given a string expression representing a...

Open The Lock Problem

LeetCode 752. You have a lock in front of you...

Network Delay Time Problem

LeetCode 743. You are given a network of n nodes,...

My Calendar III Problem

LeetCode 732. A k-booking happens when k events have some...

My Calendar II Problem

LeetCode 731. You are implementing a program to use as...

My Calendar I Problem

LeetCode 729. You are implementing a program to use as...

Knight Probability In Chessboard Problem

LeetCode 688. On an n x n chessboard, a knight...

K-Th Symbol In Grammar Problem

LeetCode 779. We build a table of n rows (1-indexed)....

Find Pivot Index Problem

LeetCode 724. Given an array of integers nums, calculate the...

Exclusive Time Of Functions Problem

LeetCode 636. On a single-threaded CPU, we execute a program...

Escape The Ghosts Problem

LeetCode 789. You are playing a simplified PAC-MAN game on...

Dota2 Senate Problem

LeetCode 649. In the world of Dota2, there are two...

Cherry Pickup Problem

LeetCode 741. You are given an n x n grid...

2 Keys Keyboard Problem

LeetCode 650. There is only one character ‘A’ on the...

Two Sum IV - Input Is A BST Problem

LeetCode 653. Given the root of a Binary Search Tree...

Trim A Binary Search Tree Problem

LeetCode 669. Given the root of a binary search tree...

To Lower Case Problem

LeetCode 709. Given a string s, return the string after...

Sum Of Square Numbers Problem

LeetCode 633. Given a non-negative integer c, decide whether there’re...

Split Array Into Consecutive Subsequences Problem

LeetCode 659. You are given an integer array nums that...

Smallest Rotation With Highest Score Problem

LeetCode 798. You are given an array nums. You can...

Smallest Range Covering Elements From K Lists Problem

LeetCode 632. You have k lists of sorted integers in...

Shortest Completing Word Problem

LeetCode 748. Given a string licensePlate and an array of...

Second Minimum Node In A Binary Tree Problem

LeetCode 671. Given a non-empty special binary tree consisting of...

Search In A Binary Search Tree Problem

LeetCode 700. You are given the root of a binary...

Rotated Digits Problem

LeetCode 788. An integer x is a good if after...

Rotate String Problem

LeetCode 796. Given two strings s and goal, return true...

Repeated String Match Problem

LeetCode 686. Given two string s a and b, return...

Remove Comments Problem

LeetCode 722. Given a C++ program, remove comments from it....

Reach A Number Problem

LeetCode 754. You are standing at position 0 on an...

Print Binary Tree Problem

LeetCode 655. Given the root of a binary tree, construct...

Prime Number Of Set Bits In Binary Representation Problem

LeetCode 762. Given two integers left and right, return the...

Prefix And Suffix Search Problem

LeetCode 745. Design a special dictionary with some words that...

Partition To K Equal Sum Subsets Problem

LeetCode 698. Given an integer array nums and an integer...

Number Of Subarrays With Bounded Maximum Problem

LeetCode 795. Given an integer array nums and two integers...

Number Of Matching Subsequences Problem

LeetCode 792. Given a string s and an array of...

Number Of Longest Increasing Subsequence Problem

LeetCode 673. Given an integer arraynums, return the number of...

Number Of Atoms Problem

LeetCode 726. Given a string formula representing a chemical formula,return...

Non-Decreasing Array Problem

LeetCode 665. Given an array nums with n integers, your...

Monotone Increasing Digits Problem

LeetCode 738. An integer has monotone increasing digits if and...

Minimum Distance Between BST Nodes Problem

LeetCode 783. Given the root of a Binary Search Tree...

Minimum Ascii Delete Sum For Two Strings Problem

LeetCode 712. Given two strings s1 ands2, return the lowest...

Min Cost Climbing Stairs Problem

LeetCode 746. You are given an integer array cost where...

Merge Two Binary Trees Problem

LeetCode 617. You are given two binary trees root1 and...

Maximum Width Of Binary Tree Problem

LeetCode 662. Given the root of a binary tree, return...

Maximum Sum Of 3 Non-Overlapping Subarrays Problem

LeetCode 689. Given an integer array nums and an integer...

Maximum Product Of Three Numbers Problem

LeetCode 628. Given an integer array nums, find three numbers...

Maximum Length Of Repeated Subarray Problem

LeetCode 718. Given two integer arrays nums1 and nums2, return...

Maximum Length Of Pair Chain Problem

LeetCode 646. You are given an array of n pairs...

Max Chunks To Make Sorted Problem

LeetCode 769. You are given an integer array arr of...

Max Chunks To Make Sorted II Problem

LeetCode 768. You are given an integer array arr.

Longest Univalue Path Problem

LeetCode 687. Given the root of a binary tree, return...

Longest Continuous Increasing Subsequence Problem

LeetCode 674. Given an unsorted array of integers nums, return...

Letter Case Permutation Problem

LeetCode 784. Given a string s, we can transform every...

Kth Smallest Number In Multiplication Table Problem

LeetCode 668. Nearly everyone has used the Multiplication Table. The...

Is Graph Bipartite? Problem

LeetCode 785. There is an undirected graph with n nodes,...

Image Smoother Problem

LeetCode 661. An image smoother is a filter of the...

Global And Local Inversions Problem

LeetCode 775. You are given an integer array nums of...

Flood Fill Problem

LeetCode 733. An image is represented by an m x...

Find Smallest Letter Greater Than Target Problem

LeetCode 744. Given a characters array letters that is sorted...

Find Duplicate File In System Problem

LeetCode 609. Given a list paths of directory info, including...

Falling Squares Problem

LeetCode 699. There are several squares being dropped onto the...

Design Circular Queue Problem

LeetCode 622. Design your implementation of the circular queue. The...

Design Circular Deque Problem

LeetCode 641. Design your implementation of the circular double-ended queue...

Cut Off Trees For Golf Event Problem

LeetCode 675. You are asked to cut off all the...

Palindromic Substrings Problem

LeetCode 647. Given a string s, return the number of...

Maximum Swap Problem

LeetCode 670. You are given an integer num. You can...

Maximum Binary Tree Problem

LeetCode 654. You are given an integer array nums with...

Maximum Average Subarray I Problem

LeetCode 643. You are given an integer array nums consisting...

Max Area Of Island Problem

LeetCode 695. You are given an m x n binary...

Map Sum Pairs Problem

LeetCode 677. Design a map that allows you to do...

Largest Plus Sign Problem

LeetCode 764. You are given an integer n. You have...

Largest Number At Least Twice Of Others Problem

LeetCode 747. You are given an integer array nums where...

Kth Largest Element In A Stream Problem

LeetCode 703. Design a class to find the k^th largest...

K-Th Smallest Prime Fraction Problem

LeetCode 786. You are given a sorted integer array arr...

K Inverse Pairs Array Problem

LeetCode 629. For an integer array nums, an inverse pair...

Insert Into A Binary Search Tree Problem

LeetCode 701. You are given the root node of a...

Implement Magic Dictionary Problem

LeetCode 676. Design a data structure that is initialized with...

Find K-Th Smallest Pair Distance Problem

LeetCode 719. The distance of a pair of integers a...

Find K Closest Elements Problem

LeetCode 658. Given a sorted integer array arr, two integers...

Find Duplicate Subtrees Problem

LeetCode 652. Given the rootof a binary tree, return all...

Employee Importance Problem

LeetCode 690. You have a data structure of employee information,...

Domino And Tromino Tiling Problem

LeetCode 790. You have two types of tiles, a 2...

Design Linked List Problem

LeetCode 707. Design your implementation of the linked list. You...

Design Hashset Problem

LeetCode 705. Design a HashSet without using any built-in hash...

Design Hashmap Problem

LeetCode 706. Design a HashMap without using any built-in hash...

Delete And Earn Problem

LeetCode 740. You are given an integer array nums. You...

Degree Of An Array Problem

LeetCode 697. Given a non-empty array of non-negative integers nums,...

Decode Ways II Problem

LeetCode 639. A message containing letters from A-Z can be...

Daily Temperatures Problem

LeetCode 739. Given an array of integers temperatures represents the...