- Introduction
- 1. Array
- 1.1 (1) 2 Sum
- 1.2 (167) 2 Sum II - Input array is sorted
- 1.3 (15) 3 Sum
- 1.4 (16) 3 Sum Closest
- 1.5 (259) 3 Sum Smaller
- 1.6 (18) 4 Sum
- 1.7 (4) Median of two Sorted Arrays
- 1.8 (26) Remove Duplicates from Sorted Array
- 1.9 (27) Remove Element
- 1.10 (41) First Missing Positive
- 1.11 (34) Search for a Range
- 1.12 (35) Search Insert Position
- 1.13 (11) Container With Most Water
- 1.14 (31) Next Permutation
- 1.15 (33) Search in Rotated Sorted Array
- 1.16 (39) Combination Sums
- 1.17 (40) Combination SumsII
- 1.18 (42) Trapping Rain Water
- 1.19 (45) Jump Game II
- 1.20 (55) Jump Game
- 1.21 (48) Rotate Image
- 1.22 (53) Maximum Subarray
- 1.23 (54) Spiral Matrix
- 1.24 (56) Merge Intervals
- 1.25 (57) Insert Interval
- 1.26 (59) Spiral Matrix II
- 1.27 (62) Unique Paths
- 1.28 (63) Unique Paths II
- 1.29 (64) Minimum PathsSum
- 1.30 (66) Plus One
- 1.31 (73) Set Matrix Zeroes
- 1.32 (74) Search a 2D Matrix
- 1.33 (75) Sort Colors
- 1.34 (78) Subsets
- 1.35 (79) Word Search
- 1.36 (80) Remove Duplicates from Sorted Array II
- 1.37 (81) Search in Rotated Sorted Array II
- 1.38 (84) Largest Rectangle in Histogram
- 1.39 (85) Maximal Rectangle
- 1.40 (88) Merge Sorted Array
- 1.41 (90) Subsets II
- 1.42 (105) Construct Binary Tree from Preorder and Inorder Traversal
- 1.43 (106) Construct Binary Tree from Inorder and Postorder Traversal
- 1.44 (118) Pascal's Triangle
- 1.45 (119) Pascal's Triangle II
- 1.46 (120) Triangle
- 1.47 (121) Best Time to Buy and Sell Stock
- 1.48 (122) Best Time to Buy and Sell Stock II
- 1.49 (123) Best Time to Buy and Sell Stock III
- 1.50 (126) Word Ladder II
- 1.51 (128) Longest Consecutive Sequence
- 1.52 (152) Maximum Product Subarray
- 1.53 (153) Find Minimum in Rotated Sorted Array
- 1.54 (154) Find Minimum in Rotated Sorted Array II
- 1.55 (162) Find Peak Element
- 1.56 (163) Missing Ranges
- 1.57 (169) Majority Element
- 1.58 (189) Rotate Array
- 1.59 (209) Minimum Size Subarray Sum
- 1.60 (216) Combination Sum III
- 1.61 (217) Contains Duplicate
- 1.62 (219) Contains Duplicate II
- 1.63 (220) Contains Duplicate III
- 1.64 (228) Summary Ranges
- 1.65 (229) Majority Element II
- 1.66 (238) Product of Array Except Self
- 1.67 (243) Shortest Word Distance
- 1.68 (245) Shortest Word Distance III
- 1.69 (268) Missing Number
- 1.70 (277) Find the Celebrity
- 1.71 (280) Wiggle Sort
- 1.72 (283) Move Zeroes
- 1.73 (287) Find the Duplicate Number
- 1.74 (289) Game of Life
- 1.75 (370) Range Addition
- 1.76 (380) Insert Delete GetRandom O(1)
- 1.77 (381) Insert Delete GetRandom O(1) - Duplicates allowed
- 1.78 (396) Rotate Function
- 1.79 (414) Third Maximum Number
- 2. Linked List
- 2.1 (2) Add Two Numbers
- 2.2 (19) Remove Nth Node
- 2.3 (21) Merge Two Sorted Lists
- 2.4 (23) Merge K Sorted Lists
- 2.5 (24) Swap Nodes in Pair
- 2.6 (25) Reverse Nodes in K Group
- 2.7 (61) Rotate List
- 2.8 (82) Remove Duplicates From Sorted List II
- 2.9 (83) Remove Duplicates From Sorted List
- 2.10 (86) Partition List
- 2.11 (92) Reverse Linked List II
- 2.12 (109) Convert Sorted List To Binary Search Tree
- 2.13 (138) Copy List With Random Pointer
- 2.14 (141) Linked List Cycle
- 2.15 (142) Linked List Cycle II
- 2.16 (143) Reorder List
- 2.17 (147) Insertion Sort List
- 2.18 (148) Sort List
- 2.19 (160) Intersection of Two Linked Lists
- 2.20 (203) Remove Linked List Elements
- 2.21 (206) Reverse Linked List
- 2.22 (234) Palindrome Linked List
- 2.23 (237) Delete Node in a Linked List
- 2.24 (328) Odd Even Linked List
- 2.25 (369) Plus One Linked List
- 3. String
- 3.1 (3) Longest Substring Without Repeating Characters
- 3.2 (5) Longest Palindromic Substring
- 3.3 (6) Zig Zag Conversion
- 3.4 (8) String To Integer
- 3.5 (12) Integer To Roman
- 3.6 (13) Roman To Integer
- 3.7 (14) Longest Common Prefix
- 3.8 (17) Letter Combination
- 3.9 (20) Valid Parentheses
- 3.10 (22) Generate Parentheses
- 3.11 (28) Implementstr Str
- 3.12 (30) Substring With Concatenation of All Words
- 3.13 (38) Count and Say
- 3.14 (43) Multiply Strings
- 3.15 (49) Group Anagrams
- 3.16 (58) Length of Last Word
- 3.17 (65) Valid Number
- 3.18 (67) Add Binary
- 3.19 (68) Text Justification
- 3.20 (71) Simplify Path
- 3.21 (76) Minimum Window Substring
- 3.22 (93) Restore I P Addresses
- 3.23 (97) Interleaving String
- 3.24 (125) Valid Palindrome
- 3.25 (132) Palindrome Partitioning II
- 3.26 (139) Word Break
- 3.27 (151) Reverse Words in String
- 3.28 (157) Read N Characters Given Read 4
- 3.29 (158) Read N Characters Given Read 4 II
- 3.30 (165) Compare Version Number
- 3.31 (186) Reverse Words Ina String II
- 3.32 (214) Shortest Palindrome
- 3.33 (227) Basic Calculator II
- 3.34 (271) Encode and Decode Strings
- 3.35 (273) Integer To English Words
- 3.36 (291) Word Pattern II
- 3.37 (336) Palindrome Pairs
- 3.38 (344) Reverse String
- 3.39 (345) Reverse Vowels of a String
- 3.40 (358) Rearrange String K Distance Apart
- 3.41 (383) Ransom Note
- 3.42 (385) Mini Parser
- 3.43 (387) First Unique Character in a String
- 3.44 (388) Longest Absolute File Path
- 3.45 (408) Valid Word Abbreviation
- 4. Hash Table
- 4.1 (36) Valid Sudoku
- 4.2 (136) Single Number
- 4.3 (149) Max Points On a Line
- 4.4 (166) Fraction To Recurring Decimal
- 4.5 (187) Repeated D N a Sequences
- 4.6 (202) Happy Number
- 4.7 (204) Count Primes
- 4.8 (205) Isomorphic Strings
- 4.9 (242) Valid Anagram
- 4.10 (246) Strobogrammatic Number
- 4.11 (249) Group Shifted Strings
- 4.12 (269) Alien Dictionary
- 4.13 (274) H Index
- 4.14 (290) Word Pattern
- 4.15 (299) Bulls and Cows
- 4.16 (347) Top K Frequent Elements
- 4.17 (349) Intersection of Two Arrays
- 4.18 (350) Intersection of Two Arrays II
- 4.19 (355) Design Twitter
- 4.20 (389) Find The Difference
- 4.21 (409) Longest Palindrome
- 4.22 (438) Find All Anagrams in a String
- 4.23 (447) Number of Boomerangs
- 4.24 (454) 4Sum II
- 5. Stack
- 6. Queue
- 7. Heap
- 8. Graph
- 9. Bit Manipulation
- 9.1 (137) Single Number II
- 9.2 (190) Reverse Bits
- 9.3 (191) Number of 1 Bits
- 9.4 (201) Bitwise and of Numbers Range
- 9.5 (231) Power of Two
- 9.6 (260) Single Number II I
- 9.7 (318) Maximum Product of Word Lengths
- 9.8 (342) Power of Four
- 9.9 (371) Sum of Two Integers
- 9.10 (393) UTF8 Validation
- 9.11 (397) Integer Replacement
- 9.12 (405) Convert a Number To Hexadecimal
- 9.13 (421) Maximum XOR of Two Numbers in an Array
- 10. Tree
- 10.1 (94) Binary Tree Inorder Traversal
- 10.2 (98) Validate Binary Search Tree
- 10.3 (99) Recover Binary Search Tree
- 10.4 (100) Same Tree
- 10.5 (101) Symmetric Tree
- 10.6 (102) Binary Tree Level Order Traversal
- 10.7 (103) Binary Tree Zigzag Level Order Traversal
- 10.8 (104) Maximum Depthof Binary Tree
- 10.9 (107) Binary Tree Level Order Traversal II
- 10.10 (108) Convert Sorted Array To Binary Search Tree
- 10.11 (110) Balanced Binary Tree
- 10.12 (111) Minimum Depthof Binary Tree
- 10.13 (112) Path Sum
- 10.14 (113) Path Sum II
- 10.15 (114) Flatten Binary Tree To Linked List
- 10.16 (116) Populating Next Right Pointers in Each Node
- 10.17 (117) Populating Next Right Pointers in Each Node II
- 10.18 (124) Binary Tree Maximum Path Sum
- 10.19 (129) Sum Root To Leaf Numbers
- 10.20 (144) Binary Tree Preorder Traversal
- 10.21 (145) Binary Tree Postorder Traversal
- 10.22 (156) Binary Tree Upside Down
- 10.23 (173) Binary Search Tree Iterator
- 10.24 (199) Binary Tree Right Side View
- 10.25 (218) The Skyline Problem
- 10.26 (220) Contain Duplicate II I
- 10.27 (222) Count Complete Tree Nodes
- 10.28 (226) Invert Binary Tree
- 10.29 (230) Kth Smallest Element Ina B S T
- 10.30 (235) Lowest Common Ancestor of a Binary Search Tree
- 10.31 (236) Lowest Common Ancestor of a Binary Tree
- 10.32 (250) Count Univalue Subtrees
- 10.33 (255) Verify Preorder Sequence in Binary Search Tree
- 10.34 (257) Binary Tree Paths
- 10.35 (270) Closest Binary Search Tree Value
- 10.36 (272) Closest Binary Search Tree Value II
- 10.37 (285) Inorder Successor in B S T
- 10.38 (297) Serialize and Deserialize Binary Tree
- 10.39 (298) Binary Tree Longest Consecutive Sequence
- 10.40 (307) Range Sum Query Mutable
- 10.41 (314) Binary Tree Vertical Order Traversal
- 10.42 (315) Count of Smaller Numbers After Self
- 10.43 (327) Count of Range Sum
- 10.44 (333) Largest B S T Subtree
- 10.45 (337) House Robber II I
- 10.46 (352) Data Stream As Disjoint Intervals
- 10.47 (366) Find Leaves of Binary Tree
- 10.48 (404) Sum of Left Leaves
- 10.49 (437) Path Sum II I
- 11. Binary Search
- 11.1 (29) Divide Two Integers
- 11.2 (50) Pow X N
- 11.3 (69) Sqrtx
- 11.4 (240) Search a 2 D Matrix II
- 11.5 (275) H Index II
- 11.6 (278) First Bad Version
- 11.7 (367) Valid Perfect Square
- 11.8 (374) Guess Number Higher Or Lower
- 11.9 (378) Kth Smallest Element in a Sorted Matrix
- 11.10 (436) Find Right Interval
- 11.11 (441) Arranging Coins
- 12. Bfs & Dfs
- 12.1 (130) Surrounded Regions
- 12.2 (133) Clone Graph
- 12.3 (200) Number of Islands
- 12.4 (207) Course Schedule
- 12.5 (210) Course Schedule II
- 12.6 (301) Remove Invalid Parentheses
- 12.7 (310) Minimum Height Trees
- 12.8 (329) Longest Increasing Path in a Matrix
- 12.9 (332) Reconstruct Itinerary
- 12.10 (417) Pacific Atlantic Water Flow
- 13. Backtracking
- 13.1 (37) Sudoku Solver
- 13.2 (46) Permutations
- 13.3 (47) Permutations II
- 13.4 (51) N Queens
- 13.5 (52) N Queens II
- 13.6 (60) Permutation Sequence
- 13.7 (77) Combinations
- 13.8 (89) Gray Code
- 13.9 (131) Palindrome Partitioning
- 13.10 (211) Add and Search Word Data Structure Design
- 13.11 (212) Word Search II
- 13.12 (254) Factor Combinations
- 13.13 (266) Palindrome Permutation
- 13.14 (267) Palindrome Permutation II
- 13.15 (401) Binary Watch
- 14. Divide and Conquer
- 15. Dynamic Programming
- 14.1 (10) Regular Express Match
- 15.2 (32) Longest Valid Parentheses
- 15.3 (44) Wildcard Matching
- 15.4 (70) Climbing Stairs
- 15.5 (72) Edit Distance
- 15.6 (87) Scramble String
- 15.7 (91) Decode Ways
- 15.8 (95) Unique Binary Search Trees II
- 15.9 (96) Unique Binary Search Trees
- 15.10 (115) Distinct Subsequences
- 15.11 (127) Word Ladder
- 15.12 (140) Word Break II
- 15.13 (159) Longest Substring With At Most Two Distinct Characters
- 15.14 (161) One Edit Distance
- 15.15 (174) Dungeon Game
- 15.16 (188) Best Timeto Buy and Sell Stock IV
- 15.17 (198) House Robber
- 15.18 (213) House Robber II
- 15.19 (221) Maximal Square
- 15.20 (244) Shortest Worddistance II
- 15.21 (256) Paint House
- 15.22 (264) Ugly Number II
- 15.23 (265) Paint House II
- 15.24 (279) Perfect Squares
- 15.25 (300) Longest Increasing Subsequence
- 15.26 (303) Range Sum Query Immutable
- 15.27 (304) Range Sum Query 2 D Immutable
- 15.28 (309) Best Time To Buy and Sell Stock With Cooldown
- 15.29 (312) Burst Balloons
- 15.30 (317) Shortest Distance From All Buildings
- 15.31 (321) Create Maximum Number
- 15.32 (322) Coin Change
- 15.33 (325) Maximum Size Subarray Sum Equals K
- 15.34 (334) Increasing Triplet Subsequence
- 15.35 (338) Counting Bits
- 15.36 (340) Longest Substring With At Most K Distinct Characters
- 15.37 (343) Integer Break
- 15.38 (354) Russian Doll Envelopes
- 15.39 (357) Count Numbers With Unique Digits
- 15.40 (363) Max Sum of Rectangle No Larger Than K
- 15.41 (368) Largest Divisible Subset
- 15.42 (375) Guess Number Higher Or Lower II
- 15.43 (376) Wiggle Subsequence
- 15.44 (377) Combination Sum IV
- 15.45 (392) Is Subsequence
- 15.46 (395) Longest Substring With At Least K Repeating Characters
- 15.47 (403) Frog Jump
- 15.48 (410) Split Array Largest Sum
- 15.49 (411) Minimum Unique Word Abbreviation
- 15.50 (413) Arithmetic Slices
- 15.51 (416) Partition Equal Subset Sum
- 15.52 (424) Longest Repeating Character Replacement
- 15.53 (446) Arithmetic Slices II Subsequence
- 16. Greedy
- 17. Sort
- 18. Math
- 18.1 (7) Reverse Integer
- 18.2 (9) Palindrome Number
- 18.3 (168) Excel Sheet Column Title
- 18.4 (171) Excel Sheet Column Number
- 18.5 (172) Factorial Trailing Zeroes
- 18.6 (223) Rectangle Area
- 18.7 (233) Number of Digit One
- 18.8 (258) Add Digits
- 18.9 (263) Ugly Number
- 18.10 (306) Additive Number
- 18.11 (319) Bulb Switcher
- 18.12 (326) Power of Three
- 18.13 (335) Self Crossing
- 18.14 (365) Water and Jug Problem
- 18.15 (372) Super Pow
- 18.16 (400) Nth Digit
- 18.17 (415) Add Strings
- 18.18 (423) Reconstruct Original Digits From English
- 18.19 (453) Minimum Moves To Equal Array Elements
- 19. Design
- 19.1 (146) LRU
- 19.2 (170) Two Sum I I I Data Structure Design
- 19.3 (208) Implement Trie Prefix Tree
- 19.4 (251) Flatten 2 D Vector
- 19.5 (281) Zigzag Iterator
- 19.6 (284) Peeking Iterator
- 19.7 (293) Flip Game
- 19.8 (294) Flip Game I I
- 19.9 (348) Design Tic Tac Toe
- 19.10 (351) Android Unlock Patterns
- 19.11 (353) Design Snake Game
- 19.12 (359) Logger Rate Limiter
- 19.13 (362) Design Hit Counter
- 19.14 (379) Design Phone Directory
- 19.15 (390) Elimination Game
- 19.16 (420) Strong Password Checker
- 19.17 (432) All Oone Data Structure
- 19.18 (439) Ternary Expression Parser
- 19.19 (444) Sequence Reconstruction
- 20. Other
- 20.1 (247) Strobogrammatic Number I I
- 20.2 (248) Strobogrammatic Number I I I
- 20.3 (252) Meeting Rooms
- 20.4 (253) Meeting Rooms I I
- 20.5 (259) 3 Sum Smaller
- 20.6 (276) Paint Fence
- 20.7 (277) Find The Celebrity
- 20.8 (286) Walls and Gates
- 20.9 (288) Unique Word Abbreviation
- 20.10 (292) Nim Game
- 20.11 (296) Best Meeting Point
- 20.12 (302) Smallest Rectangle Enclosing Black Pixels
- 20.13 (305) Number of Islands I I
- 20.14 (308) Range Sum Query 2 D Mutable
- 20.15 (311) Sparse Matrix Multiplication
- 20.16 (320) Generalized Abbreviation
- 20.17 (339) Nested List Weight Sum
- 20.19 (356) Line Reflection
- 20.20 (361) Bomb Enemy
- 20.21 (364) Nested List Weight Sum I I
- 20.22 (382) Linked List Random Node
- 20.23 (384) Shuffle an Array
- 20.24 (386) Lexicographical Numbers
- 20.25 (391) Perfect Rectangle
- 20.26 (398) Random Pick Index
- 20.27 (412) Fizz Buzz
- 20.28 (418) Sentence Screen Fitting
- 20.29 (419) Battleships in a Board
- 20.30 (422) Valid Word Square
- 20.31 (425) Word Squares
- 20.32 (440) Kth Smallest in Lexicographical Order
- 21. Sql
- 21.1 (175) Combine Two Tables
- 21.2 (176) Second Highest Salary
- 21.3 (177) Nth Highest Salary
- 21.4 (178) Rank Scores
- 21.5 (180) Consecutive Number
- 21.6 (181) Employees Earning More Than Their Manager
- 21.7 (182) Duplicate Emails
- 21.8 (183) Customers Who Never Order
- 21.9 (184) Department Highest Salary
- 21.10 (185) Department Top Three Salaries
- 21.11 (196) Delete Duplicate Emails
- 21.12 (197) Rising Temperature
- 21.13 (262) Trips and Users
- Tags