- 记录LeetCode题解,日更
- 题解语言为Java
- CSDN:https://blog.csdn.net/zhou373986278
- 欢迎大家指正(^▽^)
- 1.Two Sum
- 2.Add Two Numbers
- 3.Longes Substring Without Repeating Characters
- 4.Median of Two Sorted Arrays
- 5.Longest Palindromic Substring
- 7.Reverse Integer
- 8.String to Integer
- 9.Palindrome Number
- 10.Regular Expression Matching
- 12.Integer to Roman
- 13.Roman to Integer
- 14.Longest Common Prefix
- 15.3 Sum
- 16.3Sum Closest
- 17.Letter Combinations of a Phone Number
- 18.4 Sum
- 19.Remove Nth Node From End of List
- 20.Valid Parentheses
- 21.Merge Two Sorted Lists
- 22.Generate Parentheses
- 23.Merge K Sorted Lists
- 24.Swap Nodes In Pairs
- 25.Reverse Nodes In K-Group
- 28.Implement strStr()
- 29.Divide Two Integers
- 32.Longest Valid Parentheses
- 33.Searching Rotated Sorted Array
- 34.Find First and Last Position of Elementin Sorted Array
- 35.Search Insert Position
- 36.Valid Sudoku
- 37.Sudoku Solver
- 38.Count and Say
- 46.Permutations
- 47.Permutations II
- 49.Group Anagrams
- 50.pow(x,n)
- 51.N-Queens
- 52.N-Queens II
- 53.Maximum Subarray
- 54.Spiral Matrix
- 55.Jump Game
- 56.Merge Intervals
- 58.Length of Last Word
- 60.Permutation Sequence
- 61.Rotate List
- 62.Unique Paths
- 63.Unique Paths II
- 64.Minimum Path Sum
- 67.Add Binary
- 69.Sqrt(x)
- 70.Climbing Stairs
- 72.Edit Distance
- 74.Search A 2D Matrix
- 77.Combinations
- 78.Subsets
- 79.Word Search
- 81.Searchin Rotated Sorted Array II
- 82.Remove Duplicates From Sorted List II
- 83.Remove Duplicates from Sorted List
- 86.Partition List
- 89.Gray Code
- 90.Subsets II
- 91.Decode Ways
- 92.Reverse Linked List II
- 93.Restore IP Addresses
- 94.Binary Tree Inorder Traversal
- 95.Unique Binary Search Trees II
- 96.Unique Binary Search Trees
- 98.Validate Binary Search Tree
- 99.Recover Binary Search Tree
- 100.Same Tree
- 101.Symmetric Tree
- 102.Binary Tree Level Order Traversal
- 103.Binary Tree Zigzag Level Order Traversal
- 104. Maximum Depth of Binary Tree
- 105.Construct Binary Tree from Preorder and Inorder Traversal
- 106.Construct Binary Tree from Inorder and Postorder Traversal
- 107. Binary Tree Level Order Traversal II
- 108. Convert Sorted Array to Binary Search Tree
- 109.Convert Sorted List to Binary Search Tree
- 110.Balanced Binary Tree
- 111.Minimum Depth of Binary Tree
- 112.Path Sum
- 113. Path Sum II
- 114.Flatten Binary Tree To Linked List
- 116.Populating Next Right Pointers in Each Node
- 117.Populating Next Right Pointers in Each Node II
- 120.Triangle
- 121.Best Time to Buy and Sell Stock
- 122.Best Time to Buy and Sell Stock II
- 123.Best Time to Buy and Sell Stock III
- 124.Binary Tree Maximum Path Sum
- 125.Valid Palindrome
- 129.Sum Root to Leaf Numbers
- 130.Surrounded Regions
- 131.Palindrome Partitioning
- 133.Clone Graph
- 136.Single Number
- 139.Word Break
- 141.Linked List Cycle
- 142.Linked List Cycle II
- 143.Reorder List
- 144.Binary Tree Preorder Traversal
- 145. Binary Tree Postorder Traversal
- 147.Insertion Sort List
- 152.Maximum Product Subarray
- 153.Find Minimum in Rotated Sorted Array
- 154.Find Minimum in Rotated Sorted Array II
- 156.Binary Tree Upside Down
- 159. Longest Substring with At Most Two Distinct Characters
- 160.Intersection Of Two Linked Lists
- 162.Find Peak Element
- 163.Missing Ranges
- 167.TwoSum II
- 170.TwoSum III
- 173.Binary Search Tree Iterator
- 175.Combine Two Tables
- 176.Second 20Highest Salary
- 177.Nth Highest Salary
- 178.Rank Scores
- 180.Consecutive Numbers
- 181.Employees Earning More Than Their Managers
- 182.Duplicate Emails
- 183.Customers Who Never Order
- 184.Department Highest Salary
- 185.Department Top Three Salaries
- 187.Repeated DNA Sequences
- 190.ReverseBits
- 191.Number Of 1 Bits
- 196.Delete Duplicate Emails
- 197.Rising Temperature
- 198.House Robber
- 199.Binary Tree Right Side View
- 200.Number of Islands
- 202.Happy Number
- 203.Remove Linked List Elements
- 204.Count Primes
- 205.Isomorphic Strings
- 206.Reverse Linked List
- 207.Course Schedule
- 209.Minimum Size Subarray Sum
- 210.Course Schedule II
- 213.House Robber II
- 221.Maximal Square
- 222.Count Complete Tree Nodes
- 226.Invert Binary Tree
- 230. Kth Smallest Element in a BST
- 234.Palindrome Linked List
- 235.Lowest Common Ancestor of a Binary Search Tree
- 236.Lowest Common Ancestor of a Binary Tree
- 237.Delete Node In A LinkedList
- 240.Search a 2D Matrix II
- 242.Valid Anagram
- 244.Shortest Word Distance II
- 246.Strobo grammatic Number
- 249.Group Shifted Strings
- 250.Count Univalue Subtrees
- 254.Factor Combinations
- 255.Verify Preorder Sequence in Binary Search Tree
- 256.Paint House
- 257.Binary Tree Paths
- 261.Graph Valid Tree
- 264.Ugly Number
- 266.Palindrome Permutation
- 269.Alien Dictionary
- 270.Closest Binary Search Tree Value
- 272.Closest Binary Search Tree Value II
- 274.H-Index
- 275.H-Index II
- 276.Paint Fence
- 277.Find The Celebrity
- 278.First Bad Version
- 279.Perfect Squares
- 285.Inorder Successor in BST
- 287.FindTheDuplicateNumber
- 290.Word Pattern
- 293.Flip Game
- 294.Flip Game II
- 297.Serialize and Deserialize Binary Tree
- 298.Binary Tree Longest Consecutive Sequence
- 299.Bulls And Cows
- 300.Longest Increasing Subsequence
- 303.Range Sum Query - Immutable
- 304.Range Sum Query 2D - Immutable
- 306.Additive Number
- 309.Best Time to Buy and Sell Stock with Cooldown
- 310.Minimum Height Trees
- 311.Sparse Matrix Multiplication
- 312.Burst Balloons
- 320.Generalized Abbreviation
- 322.Coin Change
- 323.Number of Connected Components in an Undirected Graph
- 328.Odd Even Linked List
- 333.Largest BST Subtree
- 344.Reverse String
- 337.House Robber III
- 338.Counting Bits
- 339.Nested List Weight Sum
- 343.Integer Break
- 345.Reverse Vowels of a String
- 347. Top K Frequent Elements
- 349.Intersection of Two Arrays
- 350.Intersection of Two Arrays II
- 357.Count Numbers with Unique Digits
- 359.Logger Rate Limiter
- 361.Bomb Enemy
- 366.Find Leaves of Binary Tree
- 367.Valid Perfect Square
- 369.Plus One Linked List
- 374.Guess Number Higher or Lower
- 377.Combination Sum IV
- 378.Kth Smallest Element In A Sorted Matrix
- 379.Design Phone Directory
- 383.Ransom Note
- 387.First Unique Character in a String
- 389.Find The Difference
- 392.Is Subsequence
- 394.Decode String
- 401.Binary Watch
- 404.Sum of Left Leaves
- 409.Longest Palindrome
- 413.Arithmetic Slices
- 415.Add Strings
- 416.Partition Equal Subset Sum
- 426.Convert Binary Search Tree to Sorted Doubly Linked List
- 428.Serialize and Deserialize N-ary Tree
- 429.N-ary Tree Level Order Traversal
- 431.Encode N-ary Tree to Binary Tree
- 434.Number of Segments in a String
- 437.Path Sum III
- 441.Arranging Coins
- 445.Add Two Numbers II
- 447.Number of Boomerangs
- 449.Serialize and Deserialize BST
- 450.Delete Node in a BST
- 451. Sort Characters By Frequency
- 454.4Sum II
- 459.Repeated Substring Pattern
- 463.Island Perimeter
- 474.Ones and Zeroes
- 486.Predict the Winner
- 494.Target Sum
- 500.Keyboard Row
- 501.Find Mode in Binary Search Tree
- 508.Most Frequent Subtree Sum
- 510.Inorder Successor in BST II
- 511.Game Play Analysis I
- 512.Game Play Analysis II
- 513.Find Bottom Left Tree Value
- 515.Find Largest Value in Each Tree Row
- 516.Longest Palindromic Subsequence
- 520.Detect Capital
- 521.Longest Uncommon Subsequence I
- 526.Beautiful Arrangement
- 528.Random Pick with Weight
- 530.Minimum Absolute Difference in BST
- 535.Encode and Decode TinyURL
- 536. Construct Binary Tree from String
- 537.Complex Number Multiplication
- 538.Convert BST to Greater Tree
- 541.Reverse String II
- 543.Diameter of Binary Tree
- 547.Friend Circles
- 549.Binary Tree Longest Consecutive Sequence II
- 551.Student Attendance Record I
- 554.Brick Wall
- 557.Reverse Words in a String III
- 559.Maximum Depth of N-ary Tree
- 560.Subarray Sum Equals K
- 563.Binary Tree Tilt
- 572.Subtree of Another Tree
- 575.Distribute Candies
- 582.Kill Process
- 589. N-ary Tree Preorder Traversal
- 590. N-ary Tree Postorder Traversal
- 594.Longest Harmonious Subsequence
- 599.Minimum Index Sum of Two Lists
- 606.Construct String from Binary Tree
- 609.Find Duplicate File in System
- 617.Merge Two Binary Trees
- 623.Add One Row to Tree
- 637.Average of Levels in Binary Tree
- 638.Shopping Offers
- 646.Maximum Length of Pair Chain
- 647.Palindromic Substrings
- 648.Word Replace
- 650.2 Keys Keyboard
- 651.4 Keys Keyboard
- 652.Find Duplicate Subtrees
- 653.Two Sum IV - Input is a BST
- 654.Maximum Binary Tree
- 655.Print Binary Tree
- 657.Robot Return to Origin
- 658.Find K Closest Elements
- 662.Maximum Width of Binary Tree
- 663.Equal Tree Partition
- 666.Path Sum IV
- 669.Trim a Binary Search Tree
- 670.Maximum Swap
- 671.Second Minimum Node In a Binary Tree
- 676.Implement Magic Dictionary
- 680.Valid Palindrome II
- 686.Repeated String Match
- 687.Longest Univalue Path
- 690.Employee Importance
- 692.Top K Frequent Words
- 694.Number of Distinct Islands
- 696.Count Binary Substrings
- 700. Search in a Binary Search Tree
- 701.Insert Into A Binary Search Tree
- 702.Search in a Sorted Array of Unknown Size
- 704.Binary Search
- 705.Design Hash Set
- 709.To Lower Case
- 712.Minimum ASCII Delete Sum for Two Strings
- 714.Best Time to Buy and Sell Stock with Transaction Fee
- 718.Maximum Length of Repeated Subarray
- 725.Split Linked List In Parts
- 748.Shortest Completing Word
- 750.Number Of Corner Rectangles
- 771.Jewels And Stones
- 729.My Calendar I
- 733.Flood Fill
- 734. Sentence Similarity
- 739.Daily Temperatures
- 740.Delete and Earn
- 744.Find Smallest Letter Greater Than Target
- 746.Min Cost Climbing Stairs
- 760.Find Anagram Mappings
- 765.Couples Holding Hands
- 783.Minimum Distance Between BST Nodes
- 784.Letter Case Permutation
- 788.Rotated Digits
- 791.Custom Sort String
- 800.Similar RGB Color
- 804.Unique Morse Code Words
- 813.Largest Sum of Averages
- 814.Binary Tree Pruning
- 817.Linked List Components
- 819.Most Common Word
- 824.Goat Latin
- 825.Friends Of Appropriate Ages
- 842.Split Array into Fibonacci Sequence
- 852.Peak Index in a Mountain Array
- 859.Buddy Strings
- 860.Lemonade Change
- 862.Shortest Subarray with Sum at Least K
- 872.Leaf-Similar Trees
- 873.Length of Longest Fibonacci Subsequence
- 876.Middle Of The LinkedList
- 877.Stone Game
- 881.Subdomain Visit Count
- 884.Uncommon Words from Two Sentences
- 889.Construct Binary Tree from Preorder and Postorder Traversal
- 890.Find and Replace Pattern
- 893.Groups of Special-Equivalent Strings
- 894.All Possible Full Binary Trees
- 897.Increasing Order Search Tree
- 900.RLEIterator
- 911.Online Election
- 915.Partition Array into Disjoint Intervals
- 917.Reverse Only Letters
- 925.Long Pressed Name
- 926.Flip String To Monotone Increasing
- 929.Unique Email Addresses
- 931.Minimum Falling Path Sum
- 937.Reorder Log Files
- 938.Range Sum Of BST
- 944.Delete Columns to Make Sorted
- 945.Minimum Increment to Make Array Unique
- 951.Flip Equivalent Binary Trees
- 953.Verifying an Alien Dictionary
- 958.Check Completeness of a Binary Tree
- 961. N-Repeated Element in Size 2N Array
- 962.Maximum Width Ramp
- 965.Univalued Binary Tree
- 968.Binary Tree Cameras
- 979.Distribute Coins in Binary Tree
- 983.Minimum Cost For Tickets
- 987.Vertical Order Traversal of a Binary Tree
- 988.Smallest String Starting From Leaf
- 993.Cousins in Binary Tree
- 1007.Minimum Domino Rotations For Equal Row
- 1008.Construct Binary Search Tree from Preorder Traversal
- 1011.Capacity To Ship Packages Within D Days
- 1014.Best Sightseeing Pair
- 1022.Sum of Root To Leaf Binary Numbers
- 1025.Divisor Game
- 1026.Maximum Difference Between Node and Ancestor
- 1028.Recover a Tree From Preorder Traversal
- 1029.Two City Scheduling
- 1046.Last Stone Weight
- 1060.Missing Element in Sorted Array
- 1064.Fixed Point
- 1071.Greatest Common Divisor of Strings
- 1078.Occurrences After Bigram
- 1079.Letter Tile Possibilities
- 1099.Two Sum Less Than K
- 1119.Remove Vowels from a String
- 1120.Maximum Average Subtree
- 1198.Find Smallest Common Element In All Rows
- 1351.Count Negative Numbers In A Sorted Matrix