LeetCode Solution List

This is a growing list of LeetCode problems and solutions. All problems and solutions are listed under different categories.

Algorithm And Data Structure

No.   Problem   Difficulty   Solution
1   Two Sum   Easy   Link
2   Add Two Numbers   Medium   Link
3   Longest Substring Without Repeating Characters   Medium   Link
4   Median Of Two Sorted Arrays   Hard   Link
8   String To Integer (atoi)   Medium   Link
15   Three Sum   Medium   Link
18   Four Sum   Medium   Link
21   Merge Two Sorted Lists   Easy   Link
23   Merge K Sorted Lists   Hard   Link
35   Search Insert Position   Easy   Link
56   Merge Intervals   Medium   Link
69   Sqrt(x)   Easy   Link
92   Reverse Linked List II   Medium   Link
167   Two Sum Input Array Is Sorted   Easy   Link
200   Number of Islands   Medium   Link
206   Reverse Linked List   Easy   Link
208   Implement Trie (Prefix Tree)   Medium   Link
212   Word Search II   Hard   Link
234   Palindrome Linked List   Easy   Link
349   Intersection Of Two Arrays   Easy   Link
367   Valid Perfect Square   Easy   Link
380   Insert Delete GetRandom O(1)   Easy   Link
421   Maximum XOR of Two Numbers In An Array   Medium   Link
454   Four Sum II   Medium   Link
472   Concatenate Words   Hard   Link
523   Continuous Subarray Sum   Medium   Link
543   Diameter Of Binary Tree   Easy   Link
560   Subarray Sum Equals K   Medium   Link
648   Replace Words   Medium   Link
713   Subarray Product Less Than K   Medium   Link
720   Longest Word In Dictionary   Easy   Link
771   Jewels And Stones   Easy   Link
961   N-Repeated Element In Size 2N Array   Easy   Link
974   Subarray Sum Divisible By K   Medium   Link
1023   Camelcase Matching   Medium   Link
1032   Stream Of Characters   Hard   Link
1099   Two Sum Less Than K   Easy   Link
1213   Intersection Of Three Sorted Arrays   Easy   Link
1224   Maximum Equal Frequency   Hard   Link
1438   Longest Continuous Subarray With Absolute Diff Less Than Or Equal To Limit   Medium   Link
1521   Number Of Good Pairs   Easy   Link
1539   Kth Missing Positive Number   Easy   Link
1539   Kth Missing Positive Number   Easy   Link
1748   Sum Of Unique Elements   Easy   Link
1812   Determine Color Of A Chessboard Square   Easy   Link


No.   Problem   Difficulty   Solution
175   Combine Two Tables   Easy   Link
176   Second Highest Salary   Easy   Link
177   Nth Highest Salary   Medium   Link
178   Rank Scores   Medium   Link
180   Consecutive Numbers   Medium   Link
181   Employees Earning More Than Their Managers   Easy   Link
182   Duplicate Emails   Easy   Link
183   Customers Who Never Order   Easy   Link
184   Department Highest Salary   Medium   Link
185   Department Top Three Salaries   Hard   Link
196   Delete Duplicate Emails   Easy   Link
197   Rising Temperature   Easy   Link
262   Trips And Users   Hard   Link
511   Game Play Analysis I   Easy   Link
512   Game Play Analysis II   Easy   Link
534   Game Play Analysis III   Medium   Link
550   Game Play Analysis IV   Medium   Link
569   Median Employee Salary   Hard   Link
570   Managers With At Least 5 Direct Reports   Medium   Link
571   Find Median Given Frequency Of Numbers   Hard   Link
574   Winning Candidate   Medium   Link
577   Employee Bonus   Easy   Link
578   Get Highest Answer Rate Question   Medium   Link
579   Find Cumulative Salary Of An Employee   Hard   Link
580   Count Student Number In Departments   Medium   Link
584   Find Customer Referee   Easy   Link
585   Investments In 2016   Medium   Link
586   Customer Placing The Largest Number Of Orders   Easy   Link
595   Big Countries   Easy   Link
596   Classes More Than 5 Students   Easy   Link
597   Friend Requests I: Overall Acceptance Rate   Easy   Link
601   Human Traffic Of Stadium   Hard   Link
602   Friend Requests II: Who Has The Most Friends   Medium   Link
603   Consecutive Available Seats   Easy   Link
607   Sales Person   Easy   Link
608   Tree Node   Medium   Link
610   Triangle Judgement   Easy   Link
612   Shortest Distance In A Plane   Medium   Link
613   Shortest Distance In A Line   Easy   Link
614   Second Degree Follower   Medium   Link
615   Average Salary: Departments VS Company   Hard   Link
618   Students Report By Geography   Hard   Link
619   Biggest Single Number   Easy   Link
620   Not Boring Movies   Easy   Link
626   Exchange Seats   Medium   Link
627   Swap Salary   Easy   Link
1045   Customers Who Bought All Products   Medium   Link
1050   Actors And Directors Who Cooperated At Least Three Times   Easy   Link
1068   Product Sales Analysis I   Easy   Link
1069   Product Sales Analysis II   Easy   Link
1070   Product Sales Analysis III   Medium   Link
1075   Project Employees I   Easy   Link
1076   Project Employees II   Easy   Link
1077   Project Employees III   Medium   Link
1082   Sales Analysis I   Easy   Link
1083   Sales Analysis II   Easy   Link
1084   Sales Analysis III   Easy   Link
1097   Game Play Analysis V   Hard   Link
1098   Unpopular Books   Medium   Link
1107   New Users Daily Count   Medium   Link
1112   Highest Grade For Each Student   Medium   Link
1113   Reported Posts   Easy   Link
1126   Active Business   Medium   Link
1127   User Purchase Platform   Hard   Link
1132   Reported Posts II   Medium   Link
1141   User Activity For The Past 30 Days I   Easy   Link
1142   User Activity For The Past 30 Days II   Easy   Link
1148   Article Views I   Easy   Link
1149   Article Views II   Medium   Link
1158   Market Analysis I   Medium   Link
1159   Market Analysis II   Hard   Link
1164   Product Price At A Given Date   Medium   Link
1173   Immediate Food Delivery I   Easy   Link
1174   Immediate Food Delivery II   Medium   Link
1179   Reformat Department Table   Easy   Link
1193   Monthly Transactions I   Medium   Link
1194   Tournament Winners   Hard   Link
1204   Last Person To Fit In The Elevator   Medium   Link
1205   Monthly Transactions II   Medium   Link
1211   Queries Quality And Percentage   Easy   Link
1212   Team Scores In Football Tournament   Medium   Link
1225   Report Contiguous Dates   Hard   Link
1241   Number Of Comments Per Post   Easy   Link
1251   Average Selling Price   Easy   Link
1264   Page Recommendations   Medium   Link
1270   All People Report To The Given Manager   Medium   Link
1280   Students And Examinations   Easy   Link
1285   Find The Start And End Number Of Continuous Ranges   Medium   Link
1294   Weather Type In Each Country   Easy   Link
1303   Find The Team Size   Easy   Link
1308   Running Total For Different Genders   Medium   Link
1321   Restaurant Growth   Medium   Link
1322   Ads Performance   Easy   Link
1327   List The Products Ordered In A Period   Easy   Link
1336   Number Of Transactions Per Visit   Hard   Link
1341   Movie Rating   Medium   Link
1350   Students With Invalid Departments   Easy   Link
1355   Activity Participants   Medium   Link
1364   Number Of Trusted Contacts Of A Customer   Medium   Link
1369   Get The Second Most Recent Activity   Hard   Link
1378   Replace Employee ID With The Unique Identifier   Easy   Link
1384   Total Sales Amount By Year   Hard   Link
1393   Capital Gain/Loss   Medium   Link
1398   Customers Who Bought Products A And B But Not C   Medium   Link
1407   Top Travellers   Easy   Link
1412   Find The Quiet Students In All Exams   Hard   Link
1421   NPV Queries   Medium   Link
1435   Create A Session Bar Chart   Easy   Link
1440   Evaluate Boolean Expression   Medium   Link
1445   Apples & Oranges   Medium   Link
1454   Active Users   Medium   Link
1459   Rectangles Area   Medium   Link
1468   Calculate Salaries   Medium   Link
1479   Sales By Day Of The Week   Hard   Link
1484   Group Sold Products By The Date   Easy   Link
1495   Friendly Movies Streamed Last Month   Easy   Link
1501   Countries You Can Safely Invest In   Medium   Link
1511   Customer Order Frequency   Easy   Link
1517   Find Users With Valid Emails   Easy   Link
1527   Patients With A Condition   Easy   Link
1532   The Most Recent Three Orders   Medium   Link
1543   Fix Product Name Format   Easy   Link
1549   The Most Recent Orders For Each Product   Medium   Link
1555   Bank Account Summary   Medium   Link
1565   Unique Orders And Customers Per Month   Easy   Link
1571   Warehouse Manager   Easy   Link
1581   Customer Who Visited But Did Not Make Any Transactions   Easy   Link
1587   Bank Account Summary II   Easy   Link
1596   The Most Frequently Ordered Products For Each Customer   Medium   Link
1607   Sellers With No Sales   Easy   Link
1613   Find The Missing IDs   Medium   Link
1623   All Valid Triplets That Can Represent A Country   Easy   Link
1633   Percentage Of Users Attended A Contest   Easy   Link
1635   Hopper Company Queries I   Hard   Link
1645   Hopper Company Queries II   Hard   Link
1651   Hopper Company Queries III   Hard   Link
1661   Average Time Of Process Per Machine   Easy   Link
1667   Fix Names In A Table   Easy   Link
1677   Product’s Worth Over Invoices   Easy   Link
1683   Invalid Tweets   Easy   Link
1693   Daily Leads And Partners   Easy   Link
1699   Number Of Calls Between Two Persons   Medium   Link
1709   Biggest Window Between Visits   Medium   Link
1715   Count Apples And Oranges   Medium   Link
1729   Find Followers Count   Easy   Link
1731   The Number Of Employees Which Report To Each Employee   Easy   Link
1741   Find Total Time Spent By Each Employee   Easy   Link
1747   Leetflex Banned Accounts   Medium   Link
1757   Recyclable And Low Fat Products   Easy   Link
1767   Find The Subtasks That Did Not Execute   Hard   Link
1777   Product’s Price For Each Store   Easy   Link
1783   Grand Slam Titles   Medium   Link
1789   Primary Department For Each Employee   Easy   Link
1795   Rearrange Products Table   Easy   Link
1809   Ad-Free Sessions Table   Easy   Link
1811   Find Interview Candidates   Medium   Link

Related Posts

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++...