| English | 简体中文 |

leetcode-logo

My LeetCode Solutions


Last updated: 2022-04-23 14:06:35

#TitleSolutionsAcceptanceDifficultyTags
剑指 Offer II 069山峰数组的顶部Go71.2%easyArray, Binary Search
剑指 Offer II 024反转链表Go75.5%easyRecursion, Linked List
剑指 Offer II 023两个链表的第一个重合节点Go69.9%easyHash Table, Linked List, Two Pointers
剑指 Offer II 022链表中环的入口节点Go55.2%mediumHash Table, Linked List, Two Pointers
剑指 Offer II 021删除链表的倒数第 n 个结点Go52.6%mediumLinked List, Two Pointers
剑指 Offer II 020回文子字符串的个数Go71.9%mediumString, Dynamic Programming
剑指 Offer II 019最多删除一个字符得到回文Go45.7%easyGreedy, Two Pointers, String
剑指 Offer II 018有效的回文Go51.5%easyTwo Pointers, String
剑指 Offer II 017含有所有字符的最短字符串Go50.3%hardHash Table, String, Sliding Window
剑指 Offer II 016不含重复字符的最长子字符串Go47.6%mediumHash Table, String, Sliding Window
剑指 Offer II 015字符串中的所有变位词Go61.9%mediumHash Table, String, Sliding Window
剑指 Offer II 014字符串中的变位词Go51.3%mediumHash Table, Two Pointers, String, Sliding Window
剑指 Offer II 013二维子矩阵的和Go66.0%mediumDesign, Array, Matrix, Prefix Sum
剑指 Offer II 012左右两边子数组的和相等Go66.9%easyArray, Prefix Sum
剑指 Offer II 0110 和 1 个数相同的子数组Go55.7%mediumArray, Hash Table, Prefix Sum
剑指 Offer II 010和为 k 的子数组Go43.5%mediumArray, Hash Table, Prefix Sum
剑指 Offer II 009乘积小于 K 的子数组Go53.7%mediumArray, Sliding Window
剑指 Offer II 008和大于等于 target 的最短子数组Go48.9%mediumArray, Binary Search, Prefix Sum, Sliding Window
剑指 Offer II 007数组中和为 0 的三个数Go44.2%mediumArray, Two Pointers, Sorting
剑指 Offer II 006排序数组中两个数字之和Go64.2%easyArray, Two Pointers, Binary Search
剑指 Offer II 005单词长度的最大乘积Go70.7%mediumBit Manipulation, Array, String
剑指 Offer II 004只出现一次的数字Go70.8%mediumBit Manipulation, Array
剑指 Offer II 002二进制加法Go55.4%easyBit Manipulation, Math, String, Simulation
剑指 Offer II 003前 n 个数字二进制中 1 的个数Go78.6%easyBit Manipulation, Dynamic Programming
剑指 Offer II 001整数除法Go20.9%easyBit Manipulation, Math
剑指 Offer 68 - II二叉树的最近公共祖先 LCOFGo70.3%easyTree, Depth-First Search, Binary Tree
剑指 Offer 68 - I二叉搜索树的最近公共祖先 LCOFPython369.5%easyTree, Depth-First Search, Binary Search Tree, Binary Tree
剑指 Offer 64求1+2+…+n LCOFGo85.9%mediumBit Manipulation, Recursion, Brainteaser
剑指 Offer 63股票的最大利润 LCOFGo63.5%mediumArray, Dynamic Programming
剑指 Offer 62圆圈中最后剩下的数字 LCOFGo65.8%easyRecursion, Math
剑指 Offer 55 - II平衡二叉树 LCOFGo59.4%easyTree, Depth-First Search, Binary Tree
剑指 Offer 61扑克牌中的顺子 LCOFGo46.0%easyArray, Sorting
剑指 Offer 67把字符串转换成整数 LCOFPython329.0%mediumString
剑指 Offer 66构建乘积数组 LCOFGo60.0%mediumArray, Prefix Sum
剑指 Offer 59 - II队列的最大值 LCOFGo47.7%mediumDesign, Queue, Monotonic Queue
剑指 Offer 59 - I滑动窗口的最大值 LCOFGo44.6%hardQueue, Sliding Window, Monotonic Queue, Heap (Priority Queue)
剑指 Offer 65不用加减乘除做加法 LCOFGo59.2%easyBit Manipulation, Math
剑指 Offer 54二叉搜索树的第k大节点 LCOFGo76.2%easyTree, Depth-First Search, Binary Search Tree, Binary Tree
剑指 Offer 48最长不含重复字符的子字符串 LCOFGo46.4%mediumHash Table, String, Sliding Window
剑指 Offer 53 - II缺失的数字 LCOFRust44.7%easyBit Manipulation, Array, Hash Table, Math, Binary Search
剑指 Offer 58 - II左旋转字符串 LCOFGo, Rust86.0%easyMath, Two Pointers, String
剑指 Offer 53 - I在排序数组中查找数字 LCOFGo, Rust53.1%easyArray, Binary Search
剑指 Offer 58 - I翻转单词顺序 LCOFPython344.5%easyTwo Pointers, String
剑指 Offer 47礼物的最大价值 LCOFGo69.1%mediumArray, Dynamic Programming, Matrix
剑指 Offer 52两个链表的第一个公共节点 LCOFGo65.5%easyHash Table, Linked List, Two Pointers
剑指 Offer 46把数字翻译成字符串 LCOFGo52.3%mediumString, Dynamic Programming
剑指 Offer 57 - II和为s的连续正数序列 LCOFGo71.0%easyMath, Two Pointers, Enumeration
剑指 Offer 45把数组排成最小的数 LCOFGo55.6%mediumGreedy, String, Sorting
剑指 Offer 57和为s的两个数字 LCOFGo67.7%easyArray, Two Pointers, Binary Search
剑指 Offer 56 - II数组中数字出现的次数 II LCOFPython380.5%mediumBit Manipulation, Array
剑指 Offer 56 - I数组中数字出现的次数 LCOFGo69.3%mediumBit Manipulation, Array
剑指 Offer 55 - I二叉树的深度 LCOFGo79.2%easyTree, Depth-First Search, Breadth-First Search, Binary Tree
剑指 Offer 34二叉树中和为某一值的路径 LCOFPython358.5%mediumTree, Depth-First Search, Backtracking, Binary Tree
剑指 Offer 50第一个只出现一次的字符 LCOFGo, Rust62.1%easyQueue, Hash Table, String, Counting
剑指 Offer 33二叉搜索树的后序遍历序列 LCOFGo56.0%mediumStack, Tree, Binary Search Tree, Recursion, Binary Tree, Monotonic Stack
剑指 Offer 32 - III从上到下打印二叉树 III LCOFGo58.7%mediumTree, Breadth-First Search, Binary Tree
剑指 Offer 32 - II从上到下打印二叉树 II LCOFGo68.8%easyTree, Breadth-First Search, Binary Tree
剑指 Offer 32 - I从上到下打印二叉树 LCOFGo63.8%mediumTree, Breadth-First Search, Binary Tree
剑指 Offer 39数组中出现次数超过一半的数字 LCOFGo69.9%easyArray, Hash Table, Divide and Conquer, Counting, Sorting
剑指 Offer 38字符串的排列 LCOFGo58.0%mediumString, Backtracking
剑指 Offer 37序列化二叉树 LCOFJava56.8%hardTree, Depth-First Search, Breadth-First Search, Design, String, Binary Tree
剑指 Offer 31栈的压入、弹出序列 LCOFGo61.9%mediumStack, Array, Simulation
剑指 Offer 36二叉搜索树与双向链表 LCOFPython365.2%mediumStack, Tree, Depth-First Search, Binary Search Tree, Linked List, Binary Tree, Doubly-Linked List
剑指 Offer 42连续子数组的最大和 LCOFGo60.7%easyArray, Divide and Conquer, Dynamic Programming
剑指 Offer 41数据流中的中位数 LCOFGo58.4%hardDesign, Two Pointers, Data Stream, Sorting, Heap (Priority Queue)
剑指 Offer 30包含min函数的栈 LCOFRust55.2%easyStack, Design
剑指 Offer 40最小的k个数 LCOFGo57.3%easyArray, Divide and Conquer, Quickselect, Sorting, Heap (Priority Queue)
剑指 Offer 35复杂链表的复制 LCOFGo71.6%mediumHash Table, Linked List
剑指 Offer 18删除链表的节点 LCOFGo60.1%easyLinked List
剑指 Offer 24反转链表 LCOFRust74.3%easyRecursion, Linked List
剑指 Offer 16数值的整数次方 LCOFGo34.5%mediumRecursion, Math
剑指 Offer 22链表中倒数第k个节点 LCOFGo80.2%easyLinked List, Two Pointers
剑指 Offer 29顺时针打印矩阵 LCOFGo43.8%easyArray, Matrix, Simulation
剑指 Offer 15二进制中1的个数 LCOFGo75.0%easyBit Manipulation
剑指 Offer 21调整数组顺序使奇数位于偶数前面 LCOFGo64.7%easyArray, Two Pointers, Sorting
剑指 Offer 20表示数值的字符串 LCOFGo25.1%mediumString
剑指 Offer 28对称的二叉树 LCOFGo57.7%easyTree, Depth-First Search, Breadth-First Search, Binary Tree
剑指 Offer 27二叉树的镜像 LCOFGo79.4%easyTree, Depth-First Search, Breadth-First Search, Binary Tree
剑指 Offer 26树的子结构 LCOFGo46.7%mediumTree, Depth-First Search, Binary Tree
剑指 Offer 25合并两个排序的链表 LCOFGo72.7%easyRecursion, Linked List
剑指 Offer 14- I剪绳子 LCOFGo57.2%mediumMath, Dynamic Programming
剑指 Offer 07重建二叉树 LCOFGo70.2%mediumTree, Array, Hash Table, Divide and Conquer, Binary Tree
剑指 Offer 06从尾到头打印链表 LCOFRust75.0%easyStack, Recursion, Linked List, Two Pointers
剑指 Offer 13机器人的运动范围 LCOFPython353.3%mediumDepth-First Search, Breadth-First Search, Dynamic Programming
剑指 Offer 05替换空格 LCOFRust75.9%easyString
剑指 Offer 12矩阵中的路径 LCOFGo45.3%mediumArray, Backtracking, Matrix
剑指 Offer 11旋转数组的最小数字 LCOFRust49.2%easyArray, Binary Search
剑指 Offer 10- II青蛙跳台阶问题 LCOFGo45.4%easyMemoization, Math, Dynamic Programming
剑指 Offer 04二维数组中的查找 LCOFRust40.1%mediumArray, Binary Search, Divide and Conquer, Matrix
剑指 Offer 03数组中重复的数字 LCOFGo67.9%easyArray, Hash Table, Sorting
剑指 Offer 10- I斐波那契数列 LCOFGo36.2%easyMemoization, Math, Dynamic Programming
剑指 Offer 09用两个栈实现队列 LCOFRust70.9%easyStack, Design, Queue
2212Maximum Points in an Archery CompetitionC++46.5%mediumBit Manipulation, Recursion, Array, Enumeration
2211Count Collisions on a RoadC++38.5%mediumStack, String
2210Count Hills and Valleys in an ArrayGo57.6%easyArray
2206Divide Array Into Equal PairsGo76.5%easyBit Manipulation, Array, Hash Table, Counting
2196Create Binary Tree From DescriptionsPython373.2%mediumTree, Depth-First Search, Breadth-First Search, Array, Hash Table, Binary Tree
2195Append K Integers With Minimal SumPython322.9%mediumGreedy, Array, Math, Sorting
2194Cells in a Range on an Excel SheetGo85.0%easyString
2182Construct String With Repeat LimitJava47.7%mediumGreedy, String, Counting, Heap (Priority Queue)
2181Merge Nodes in Between ZerosGo86.3%mediumLinked List, Simulation
2180Count Integers With Even Digit SumGo65.0%easyMath, Simulation
2187Minimum Time to Complete TripsPython326.0%mediumArray, Binary Search
2186Minimum Number of Steps to Make Two Strings Anagram IIGo71.6%mediumHash Table, String, Counting
2185Counting Words With a Given PrefixGo79.3%easyArray, String
2170Minimum Operations to Make the Array AlternatingPython329.2%mediumGreedy, Array, Hash Table, Counting
2169Count Operations to Obtain ZeroGo76.0%easyMath, Simulation
2177Find Three Consecutive Integers That Sum to a Given NumberGo68.9%mediumMath, Simulation
2176Count Equal and Divisible Pairs in an ArrayGo80.9%easyArray
2104Sum of Subarray RangesGo62.7%mediumStack, Array, Monotonic Stack
2100Find Good Days to Rob the BankGo48.6%mediumArray, Dynamic Programming, Prefix Sum
2049Count Nodes With the Highest ScoreGo51.7%mediumTree, Depth-First Search, Array, Binary Tree
2044Count Number of Maximum Bitwise-OR SubsetsGo81.9%mediumBit Manipulation, Array, Backtracking
2043Simple Bank SystemGo67.6%mediumDesign, Array, Hash Table, Simulation
2055Plates Between CandlesGo43.2%mediumArray, String, Binary Search, Prefix Sum
2028Find Missing ObservationsGo50.7%mediumArray, Math, Simulation
2039The Time When the Network Becomes IdleGo55.8%mediumBreadth-First Search, Graph, Array
2038Remove Colored Pieces if Both Neighbors are the Same ColorGo63.7%mediumGreedy, Math, String, Game Theory
2016Maximum Difference Between Increasing ElementsGo60.3%easyArray
2024Maximize the Confusion of an ExamGo57.2%mediumString, Binary Search, Prefix Sum, Sliding Window
2000Reverse Prefix of WordGo, Rust79.5%easyTwo Pointers, String
2006Count Number of Pairs With Absolute Difference KGo, Rust85.5%easyArray, Hash Table, Counting
1984Minimum Difference Between Highest and Lowest of K ScoresGo62.9%easyArray, Sorting, Sliding Window
1994The Number of Good SubsetsGo56.8%hardBit Manipulation, Array, Math, Dynamic Programming, Bitmask
1791Find Center of Star GraphGo84.0%easyGraph
1765Map of Highest PeakRust66.5%mediumBreadth-First Search, Array, Matrix
1763Longest Nice SubstringRust69.1%easyBit Manipulation, Hash Table, String, Sliding Window
1748Sum of Unique ElementsGo, Rust79.0%easyArray, Hash Table, Counting
1725Number Of Rectangles That Can Form The Largest SquareGo, Rust83.4%easyArray
1719Number Of Ways To Reconstruct A TreeGo69.8%hardTree, Graph, Topological Sort
1631Path With Minimum EffortGo49.9%mediumDepth-First Search, Breadth-First Search, Union Find, Array, Binary Search, Matrix, Heap (Priority Queue)
1601Maximum Number of Achievable Transfer RequestsGo61.6%hardBit Manipulation, Array, Backtracking, Enumeration
1606Find Servers That Handled Most Number of RequestsGo48.2%hardGreedy, Array, Ordered Set, Heap (Priority Queue)
1584Min Cost to Connect All PointsGo66.2%mediumUnion Find, Array, Minimum Spanning Tree
1579Remove Max Number of Edges to Keep Graph Fully TraversableGo61.9%hardUnion Find, Graph
1588Sum of All Odd Length SubarraysGo83.9%easyArray, Math, Prefix Sum
1489Find Critical and Pseudo-Critical Edges in Minimum Spanning TreeGo68.5%hardUnion Find, Graph, Minimum Spanning Tree, Sorting, Strongly Connected Component
1480Running Sum of 1d ArrayGo86.9%easyArray, Prefix Sum
1447Simplified FractionsGo, Rust67.8%mediumMath, String, Number Theory
1423Maximum Points You Can Obtain from CardsGo55.5%mediumArray, Prefix Sum, Sliding Window
1414Find the Minimum Number of Fibonacci Numbers Whose Sum Is KRust70.6%mediumGreedy
1380Lucky Numbers in a MatrixGo77.0%easyArray, Matrix
1342Number of Steps to Reduce a Number to ZeroRust82.6%easyBit Manipulation, Math
1319Number of Operations to Make Network ConnectedGo61.9%mediumDepth-First Search, Breadth-First Search, Union Find, Graph
2215Find the Difference of Two ArraysGo66.8%easyArray, Hash Table
2217Find Palindrome With Fixed LengthC++32.0%mediumArray, Math
2216Minimum Deletions to Make Array BeautifulGo46.8%mediumStack, Greedy, Array
1232Check If It Is a Straight LineGo46.5%easyGeometry, Array, Math
1221Split a String in Balanced StringsGo84.4%easyGreedy, String, Counting
1219Path with Maximum GoldGo, Rust69.7%mediumArray, Backtracking, Matrix
1218Longest Arithmetic Subsequence of Given DifferenceGo51.5%mediumArray, Hash Table, Dynamic Programming
1706Where Will the Ball FallGo69.3%mediumDepth-First Search, Array, Dynamic Programming, Matrix, Simulation
1208Get Equal Substrings Within BudgetGo49.8%mediumString, Binary Search, Prefix Sum, Sliding Window
1203Sort Items by Groups Respecting DependenciesGo61.8%hardDepth-First Search, Breadth-First Search, Graph, Topological Sort
1202Smallest String With Swaps❤️Go50.5%mediumDepth-First Search, Breadth-First Search, Union Find, Hash Table, String
1405Longest Happy StringRust64.0%mediumGreedy, String, Heap (Priority Queue)
1189Maximum Number of BalloonsGo68.7%easyHash Table, String, Counting
1128Number of Equivalent Domino PairsGo54.3%easyArray, Hash Table, Counting
1046Last Stone WeightGo65.8%easyArray, Heap (Priority Queue)
1020Number of EnclavesGo61.0%mediumDepth-First Search, Breadth-First Search, Union Find, Array, Matrix
1018Binary Prefix Divisible By 5Go51.4%easyArray
1004Max Consecutive Ones IIIGo60.0%mediumArray, Binary Search, Prefix Sum, Sliding Window
1001Grid IlluminationGo45.1%hardArray, Hash Table
995Minimum Number of K Consecutive Bit FlipsGo53.4%hardBit Manipulation, Array, Prefix Sum, Sliding Window
992Subarrays with K Different IntegersGo46.2%hardArray, Hash Table, Counting, Sliding Window
989Add to Array-Form of IntegerGo46.9%easyArray, Math
978Longest Turbulent SubarrayGo47.3%mediumArray, Dynamic Programming, Sliding Window
509Fibonacci NumberGo66.6%easyRecursion, Memoization, Math, Dynamic Programming
969Pancake SortingGo67.9%mediumGreedy, Array, Two Pointers, Sorting
959Regions Cut By SlashesGo74.2%mediumDepth-First Search, Breadth-First Search, Union Find, Graph
954Array of Doubled PairsGo38.9%mediumGreedy, Array, Hash Table, Sorting
947Most Stones Removed with Same Row or ColumnGo61.2%mediumDepth-First Search, Union Find, Graph
917Reverse Only LettersGo60.3%easyTwo Pointers, String
888Fair Candy SwapGo64.0%easyArray, Hash Table, Binary Search, Sorting
887Super Egg DropGo29.6%hardMath, Binary Search, Dynamic Programming
881Boats to Save PeopleGo53.8%mediumGreedy, Array, Two Pointers, Sorting
869Reordered Power of 2Go64.1%mediumMath, Counting, Enumeration, Sorting
861Score After Flipping MatrixGo80.8%mediumGreedy, Bit Manipulation, Array, Matrix
860Lemonade ChangeGo58.5%easyGreedy, Array
842Split Array into Fibonacci SequenceGo48.6%mediumString, Backtracking
839Similar String GroupsGo57.9%hardDepth-First Search, Breadth-First Search, Union Find, Array, String
838Push DominoesGo55.4%mediumTwo Pointers, String, Dynamic Programming
830Positions of Large GroupsGo54.3%easyString
803Bricks Falling When HitGo47.7%hardUnion Find, Array, Matrix
798Smallest Rotation with Highest ScoreGo61.4%hardArray, Prefix Sum
797All Paths From Source to TargetGo78.8%mediumDepth-First Search, Breadth-First Search, Graph, Backtracking
796Rotate StringGo63.0%easyString, String Matching
787Cheapest Flights Within K StopsGo38.9%mediumDepth-First Search, Breadth-First Search, Graph, Dynamic Programming, Shortest Path, Heap (Priority Queue)
778Swim in Rising WaterGo58.9%hardDepth-First Search, Breadth-First Search, Union Find, Array, Binary Search, Matrix, Heap (Priority Queue)
703Kth Largest Element in a StreamGo51.9%easyTree, Design, Binary Search Tree, Binary Tree, Data Stream, Heap (Priority Queue)
766Toeplitz MatrixGo70.5%easyArray, Matrix
590N-ary Tree Postorder TraversalGo77.8%easyStack, Tree, Depth-First Search
589N-ary Tree Preorder TraversalGo76.1%easyStack, Tree, Depth-First Search
765Couples Holding HandsGo66.3%hardGreedy, Depth-First Search, Breadth-First Search, Union Find, Graph
763Partition LabelsGo76.6%mediumGreedy, Hash Table, Two Pointers, String
762Prime Number of Set Bits in Binary RepresentationGo75.7%easyBit Manipulation, Math
746Min Cost Climbing StairsGo61.6%easyArray, Dynamic Programming
744Find Smallest Letter Greater Than TargetGo49.7%easyArray, Binary Search
739Daily Temperatures❤️Go69.0%mediumStack, Array, Monotonic Stack
738Monotone Increasing DigitsGo50.0%mediumGreedy, Math
728Self Dividing NumbersGo78.9%easyMath
724Find Pivot IndexGo48.4%easyArray, Prefix Sum
721Accounts MergeGo47.4%mediumDepth-First Search, Breadth-First Search, Union Find, Array, String
720Longest Word in DictionaryGo51.9%easyTrie, Array, Hash Table, String, Sorting
7171-bit and 2-bit CharactersGo55.4%easyArray
714Best Time to Buy and Sell Stock with Transaction FeeGo73.7%mediumGreedy, Array, Dynamic Programming
713Subarray Product Less Than KGo44.0%mediumArray, Sliding Window
695Max Area of IslandGo67.4%mediumDepth-First Search, Breadth-First Search, Union Find, Array, Matrix
693Binary Number with Alternating BitsGo65.4%easyBit Manipulation
688Knight Probability in ChessboardGo58.3%mediumDynamic Programming
687Longest Univalue PathGo44.8%mediumTree, Depth-First Search, Binary Tree
685Redundant Connection IIGo42.3%hardDepth-First Search, Breadth-First Search, Union Find, Graph
684Redundant ConnectionGo66.9%mediumDepth-First Search, Breadth-First Search, Union Find, Graph
682Baseball GameGo72.3%easyStack, Array, Simulation
680Valid Palindrome IIGo40.1%easyGreedy, Two Pointers, String
677Map Sum PairsGo66.5%mediumDesign, Trie, Hash Table, String
674Longest Continuous Increasing SubsequenceGo52.2%easyArray
671Second Minimum Node In a Binary TreeGo48.3%easyTree, Depth-First Search, Binary Tree
669Trim a Binary Search TreeGo66.6%mediumTree, Depth-First Search, Binary Search Tree, Binary Tree
665Non-decreasing ArrayGo27.4%mediumArray
661Image SmootherGo64.5%easyArray, Matrix
653Two Sum IV - Input is a BSTGo63.0%easyTree, Depth-First Search, Breadth-First Search, Binary Search Tree, Hash Table, Two Pointers, Binary Tree
649Dota2 SenateGo47.9%mediumGreedy, Queue, String
647Palindromic SubstringsGo66.2%mediumString, Dynamic Programming
643Maximum Average Subarray I❤️Go44.5%easyArray, Sliding Window
638Shopping OffersGo64.4%mediumBit Manipulation, Memoization, Array, Dynamic Programming, Backtracking, Bitmask
637Average of Levels in Binary TreeGo69.4%easyTree, Depth-First Search, Breadth-First Search, Binary Tree
633Sum of Square NumbersGo39.0%mediumMath, Two Pointers, Binary Search
629K Inverse Pairs ArrayGo51.9%hardDynamic Programming
628Maximum Product of Three NumbersGo52.4%easyArray, Math, Sorting
627Swap SalarySQL81.4%easyDatabase
626Exchange SeatsSQL68.6%mediumDatabase
621Task SchedulerGo58.1%mediumGreedy, Array, Hash Table, Counting, Sorting, Heap (Priority Queue)
620Not Boring MoviesSQL77.2%easyDatabase
617Merge Two Binary TreesGo78.9%easyTree, Depth-First Search, Breadth-First Search, Binary Tree
606Construct String from Binary TreeGo63.1%easyTree, Depth-First Search, String, Binary Tree
605Can Place FlowersGo33.0%easyGreedy, Array
599Minimum Index Sum of Two ListsGo57.3%easyArray, Hash Table, String
598Range Addition IIGo57.2%easyArray, Math
596Classes More Than 5 StudentsSQL45.5%easyDatabase
595Big CountriesSQL74.9%easyDatabase
581Shortest Unsorted Continuous SubarrayGo41.0%mediumStack, Greedy, Array, Two Pointers, Sorting, Monotonic Stack
575Distribute CandiesGo71.0%easyArray, Hash Table
572Subtree of Another TreeGo47.5%easyTree, Depth-First Search, Binary Tree, String Matching, Hash Function
567Permutation in StringGo43.7%mediumHash Table, Two Pointers, String, Sliding Window
566Reshape the MatrixGo66.6%easyArray, Matrix, Simulation
564Find the Closest PalindromeGo30.4%hardMath, String
561Array Partition IGo78.0%easyGreedy, Array, Counting Sort, Sorting
560Subarray Sum Equals K❤️Go45.0%mediumArray, Hash Table, Prefix Sum
553Optimal DivisionGo65.0%mediumArray, Math, Dynamic Programming
547Number of ProvincesGo62.0%mediumDepth-First Search, Breadth-First Search, Union Find, Graph
543Diameter of Binary Tree❤️Go56.7%easyTree, Depth-First Search, Binary Tree
540Single Element in a Sorted ArrayGo60.8%mediumArray, Binary Search
538Convert BST to Greater TreeGo73.2%mediumTree, Depth-First Search, Binary Search Tree, Binary Tree
537Complex Number MultiplicationGo74.9%mediumMath, String, Simulation
525Contiguous ArrayGo54.1%mediumArray, Hash Table, Prefix Sum
524Longest Word in Dictionary through DeletingGo49.8%mediumArray, Two Pointers, String, Sorting
521Longest Uncommon Subsequence IGo73.8%easyString
520Detect CapitalGo57.4%easyString
513Find Bottom Left Tree ValueGo73.1%mediumTree, Depth-First Search, Breadth-First Search, Binary Tree
507Perfect NumberC49.0%easyMath
504Base 7Go52.2%easyMath
503Next Greater Element IIGo65.0%mediumStack, Array, Monotonic Stack
502IPOGo44.3%hardGreedy, Array, Sorting, Heap (Priority Queue)
501Find Mode in Binary Search TreeGo53.0%easyTree, Depth-First Search, Binary Search Tree, Binary Tree
500Keyboard RowGo74.4%easyArray, Hash Table, String
496Next Greater Element IGo71.0%easyStack, Array, Hash Table, Monotonic Stack
495Teemo AttackingGo60.4%easyArray, Simulation
494Target SumGo49.0%mediumArray, Dynamic Programming, Backtracking
492Construct the RectangleGo60.7%easyMath
488Zuma GameGo51.3%hardBreadth-First Search, Memoization, String, Dynamic Programming
485Max Consecutive OnesGo61.0%easyArray
480Sliding Window MedianGo44.7%hardArray, Hash Table, Sliding Window, Heap (Priority Queue)
476Number ComplementGo71.1%easyBit Manipulation
461Hamming DistanceGo81.5%easyBit Manipulation
460LFU CacheGo44.0%hardDesign, Hash Table, Linked List, Doubly-Linked List
455Assign CookiesGo57.3%easyGreedy, Array, Sorting
453Minimum Moves to Equal Array ElementsGo61.3%easyArray, Math
452Minimum Number of Arrows to Burst BalloonsGo50.7%mediumGreedy, Array, Sorting
451Sort Characters By FrequencyGo71.6%mediumHash Table, String, Bucket Sort, Counting, Sorting, Heap (Priority Queue)
448Find All Numbers Disappeared in an ArrayGo65.4%easyArray, Hash Table
447Number of BoomerangsGo66.5%mediumArray, Hash Table, Math
441Arranging CoinsGo45.8%easyMath, Binary Search
440K-th Smallest in Lexicographical OrderGo42.7%hardTrie
438Find All Anagrams in a String❤️Go54.4%mediumHash Table, String, Sliding Window
437Path Sum III❤️Go57.1%mediumTree, Depth-First Search, Binary Tree
435Non-overlapping IntervalsGo50.7%mediumGreedy, Array, Dynamic Programming, Sorting
432All O`one Data StructureGo47.2%hardDesign, Hash Table, Linked List, Doubly-Linked List
424Longest Repeating Character ReplacementGo53.7%mediumHash Table, String, Sliding Window
420Strong Password CheckerGo39.4%hardGreedy, String, Heap (Priority Queue)
416Partition Equal Subset Sum❤️Go51.5%mediumArray, Dynamic Programming
412Fizz BuzzGo71.3%easyMath, String, Simulation
407Trapping Rain Water IIGo57.8%hardBreadth-First Search, Array, Matrix, Heap (Priority Queue)
406Queue Reconstruction by HeightGo74.8%mediumGreedy, Binary Indexed Tree, Segment Tree, Array, Sorting
404Sum of Left LeavesGo60.3%easyTree, Depth-First Search, Breadth-First Search, Binary Tree
399Evaluate DivisionGo59.2%mediumDepth-First Search, Breadth-First Search, Union Find, Graph, Array, Shortest Path
395Longest Substring with At Least K Repeating Characters❤️Go52.3%mediumHash Table, String, Divide and Conquer, Sliding Window
394Decode String❤️Go56.0%mediumStack, Recursion, String
393UTF-8 ValidationGo43.9%mediumBit Manipulation, Array
392Is SubsequenceGo52.1%easyTwo Pointers, String, Dynamic Programming
389Find the DifferenceGo68.5%easyBit Manipulation, Hash Table, String, Sorting
387First Unique Character in a StringGo54.7%easyQueue, Hash Table, String, Counting
376Wiggle SubsequenceGo47.0%mediumGreedy, Array, Dynamic Programming
375Guess Number Higher or Lower IIGo60.7%mediumMath, Dynamic Programming, Game Theory
367Valid Perfect SquareGo44.8%easyMath, Binary Search
354Russian Doll EnvelopesGo42.9%hardArray, Binary Search, Dynamic Programming, Sorting
352Data Stream as Disjoint IntervalsGo67.6%hardDesign, Binary Search, Ordered Set
349Intersection of Two ArraysGo74.0%easyArray, Hash Table, Two Pointers, Binary Search, Sorting
347Top K Frequent ElementsGo62.9%mediumArray, Hash Table, Divide and Conquer, Bucket Sort, Counting, Quickselect, Sorting, Heap (Priority Queue)
345Reverse Vowels of a StringGo54.2%easyTwo Pointers, String
344Reverse StringGo78.4%easyRecursion, Two Pointers, String
338Counting BitsGo78.6%easyBit Manipulation, Dynamic Programming
337House Robber IIIGo60.7%mediumTree, Depth-First Search, Dynamic Programming, Binary Tree
335Self CrossingGo42.9%hardGeometry, Array, Math
330Patching ArrayGo53.0%hardGreedy, Array
328Odd Even Linked ListGo65.4%mediumLinked List
326Power of ThreeGo50.6%easyRecursion, Math
322Coin ChangeGo45.5%mediumBreadth-First Search, Array, Dynamic Programming
319Bulb SwitcherGo57.3%mediumBrainteaser, Math
318Maximum Product of Word LengthsGo73.8%mediumBit Manipulation, Array, String
316Remove Duplicate LettersGo47.8%mediumStack, Greedy, String, Monotonic Stack
310Minimum Height TreesGo43.2%mediumDepth-First Search, Breadth-First Search, Graph, Topological Sort
309Best Time to Buy and Sell Stock with CooldownGo62.7%mediumArray, Dynamic Programming
307Range Sum Query - MutableGo50.6%mediumDesign, Binary Indexed Tree, Segment Tree, Array
304Range Sum Query 2D - ImmutableGo58.3%mediumDesign, Array, Matrix, Prefix Sum
303Range Sum Query - ImmutableGo74.6%easyDesign, Array, Prefix Sum
301Remove Invalid ParenthesesGo55.0%hardBreadth-First Search, String, Backtracking
300Longest Increasing Subsequence❤️Go53.3%mediumArray, Binary Search, Dynamic Programming
299Bulls and CowsGo56.6%mediumHash Table, String, Counting
295Find Median from Data StreamGo52.6%hardDesign, Two Pointers, Data Stream, Sorting, Heap (Priority Queue)
290Word PatternGo45.3%easyHash Table, String
287Find the Duplicate NumberGo65.0%mediumBit Manipulation, Array, Two Pointers, Binary Search
283Move ZeroesGo63.9%easyArray, Two Pointers
282Expression Add OperatorsGo48.0%hardMath, String, Backtracking
279Perfect SquaresGo64.6%mediumBreadth-First Search, Math, Dynamic Programming
278First Bad VersionJava45.1%easyBinary Search, Interactive
273Integer to English WordsGo36.6%hardRecursion, Math, String
268Missing NumberGo65.6%easyBit Manipulation, Array, Hash Table, Math, Sorting
260Single Number IIIGo73.5%mediumBit Manipulation, Array
258Add DigitsGo71.0%easyMath, Number Theory, Simulation
242Valid AnagramGo65.2%easyHash Table, String, Sorting
241Different Ways to Add ParenthesesGo73.5%mediumRecursion, Memoization, Math, String, Dynamic Programming
240Search a 2D Matrix IIGo50.9%mediumArray, Binary Search, Divide and Conquer, Matrix
239Sliding Window MaximumGo49.8%hardQueue, Array, Sliding Window, Monotonic Queue, Heap (Priority Queue)
238Product of Array Except SelfGo73.3%mediumArray, Prefix Sum
237Delete Node in a Linked ListGo85.9%easyLinked List
236Lowest Common Ancestor of a Binary TreeGo68.9%mediumTree, Depth-First Search, Binary Tree
234Palindrome Linked ListGo51.3%easyStack, Recursion, Linked List, Two Pointers
232Implement Queue using StacksGo68.8%easyStack, Design, Queue
230Kth Smallest Element in a BSTGo75.3%mediumTree, Depth-First Search, Binary Search Tree, Binary Tree
229Majority Element IIGo53.5%mediumArray, Hash Table, Counting, Sorting
228Summary RangesGo56.8%easyArray
226Invert Binary TreeGo79.1%easyTree, Depth-First Search, Breadth-First Search, Binary Tree
225Implement Stack using QueuesGo67.6%easyStack, Design, Queue
221Maximal SquareGo48.8%mediumArray, Dynamic Programming, Matrix
220Contains Duplicate IIIGo28.9%mediumArray, Bucket Sort, Ordered Set, Sorting, Sliding Window
218The Skyline Problem❤️Go54.5%hardBinary Indexed Tree, Segment Tree, Array, Divide and Conquer, Ordered Set, Line Sweep, Heap (Priority Queue)
217Contains DuplicateGo55.6%easyArray, Hash Table, Sorting
215Kth Largest Element in an ArrayGo64.7%mediumArray, Divide and Conquer, Quickselect, Sorting, Heap (Priority Queue)
213House Robber IIGo43.6%mediumArray, Dynamic Programming
212Word Search IIGo45.8%hardTrie, Array, String, Backtracking, Matrix
211Design Add and Search Words Data StructureGo51.0%mediumDepth-First Search, Design, Trie, String
210Course Schedule IIGo55.4%mediumDepth-First Search, Breadth-First Search, Graph, Topological Sort
209Minimum Size Subarray SumGo48.5%mediumArray, Binary Search, Prefix Sum, Sliding Window
208Implement Trie (Prefix Tree)❤️Go71.9%mediumDesign, Trie, Hash Table, String
207Course ScheduleGo53.9%mediumDepth-First Search, Breadth-First Search, Graph, Topological Sort
206Reverse Linked ListGo, php72.9%easyRecursion, Linked List
205Isomorphic StringsGo49.8%easyHash Table, String
204Count PrimesGo37.5%mediumArray, Math, Enumeration, Number Theory
200Number of IslandsGo57.5%mediumDepth-First Search, Breadth-First Search, Union Find, Array, Matrix
198House Robber❤️Go53.0%mediumArray, Dynamic Programming
196Delete Duplicate EmailsSQL66.9%easyDatabase
191Number of 1 BitsGo75.7%easyBit Manipulation
190Reverse BitsGo70.9%easyBit Manipulation, Divide and Conquer
189Rotate ArrayGo44.3%mediumArray, Math, Two Pointers
188Best Time to Buy and Sell Stock IVGo41.1%hardArray, Dynamic Programming
184Department Highest SalarySQL49.2%mediumDatabase
183Customers Who Never OrderSQL67.2%easyDatabase
182Duplicate EmailsSQL79.3%easyDatabase
181Employees Earning More Than Their ManagersSQL69.2%easyDatabase
180Consecutive NumbersSQL48.3%mediumDatabase
178Rank ScoresSQL60.4%mediumDatabase
177Nth Highest SalarySQL46.4%mediumDatabase
176Second Highest SalarySQL35.6%mediumDatabase
175Combine Two TablesSQL73.5%easyDatabase
172Factorial Trailing ZeroesGo48.2%mediumMath
169Majority ElementGo66.7%easyArray, Hash Table, Divide and Conquer, Counting, Sorting
167Two Sum II - Input Array Is SortedGo58.5%mediumArray, Two Pointers, Binary Search
166Fraction to Recurring DecimalGo33.3%mediumHash Table, Math, String
160Intersection of Two Linked ListsGo62.6%easyHash Table, Linked List, Two Pointers
155Min StackGo58.0%easyStack, Design
153Find Minimum in Rotated Sorted ArrayGo56.9%mediumArray, Binary Search
152Maximum Product SubarrayGo42.5%mediumArray, Dynamic Programming
149Max Points on a Line❤️Go36.5%hardGeometry, Array, Hash Table, Math
148Sort ListGo66.5%mediumLinked List, Two Pointers, Divide and Conquer, Sorting, Merge Sort
146LRU Cache❤️Go52.7%mediumDesign, Hash Table, Linked List, Doubly-Linked List
145Binary Tree Postorder TraversalGo75.7%easyStack, Tree, Depth-First Search, Binary Tree
144Binary Tree Preorder TraversalGo71.0%easyStack, Tree, Depth-First Search, Binary Tree
142Linked List Cycle IIGo56.0%mediumHash Table, Linked List, Two Pointers
141Linked List CycleGo51.4%easyHash Table, Linked List, Two Pointers
140Word Break IIGo52.4%hardTrie, Memoization, Hash Table, String, Dynamic Programming, Backtracking
139Word Break❤️Go52.9%mediumTrie, Memoization, Hash Table, String, Dynamic Programming
137Single Number IIGo72.1%mediumBit Manipulation, Array
136Single NumberGo72.1%easyBit Manipulation, Array
135CandyGo48.9%hardGreedy, Array
131Palindrome PartitioningGo72.8%mediumString, Dynamic Programming, Backtracking
130Surrounded RegionsGo45.5%mediumDepth-First Search, Breadth-First Search, Union Find, Array, Matrix
127Word LadderGo47.4%hardBreadth-First Search, Hash Table, String
125Valid PalindromeGo46.9%easyTwo Pointers, String
123Best Time to Buy and Sell Stock IIIGo55.7%hardArray, Dynamic Programming
122Best Time to Buy and Sell Stock IIGo70.2%mediumGreedy, Array, Dynamic Programming
121Best Time to Buy and Sell Stock❤️Go57.7%easyArray, Dynamic Programming
119Pascal’s Triangle IIGo68.2%easyArray, Dynamic Programming
118Pascal’s TriangleGo74.6%easyArray, Dynamic Programming
114Flatten Binary Tree to Linked ListGo72.8%mediumStack, Tree, Depth-First Search, Linked List, Binary Tree
112Path SumGo53.2%easyTree, Depth-First Search, Breadth-First Search, Binary Tree
111Minimum Depth of Binary TreeGo50.1%easyTree, Depth-First Search, Breadth-First Search, Binary Tree
110Balanced Binary TreeGo56.9%easyTree, Depth-First Search, Binary Tree
105Construct Binary Tree from Preorder and Inorder TraversalGo71.0%mediumTree, Array, Hash Table, Divide and Conquer, Binary Tree
104Maximum Depth of Binary Tree❤️Go76.9%easyTree, Depth-First Search, Breadth-First Search, Binary Tree
103Binary Tree Zigzag Level Order TraversalGo57.3%mediumTree, Breadth-First Search, Binary Tree
102Binary Tree Level Order TraversalGo64.7%mediumTree, Breadth-First Search, Binary Tree
101Symmetric Tree❤️Go57.5%easyTree, Depth-First Search, Breadth-First Search, Binary Tree
98Validate Binary Search Tree❤️Go35.9%mediumTree, Depth-First Search, Binary Search Tree, Binary Tree
96Unique Binary Search Trees❤️Go70.2%mediumTree, Binary Search Tree, Math, Dynamic Programming, Binary Tree
95Unique Binary Search Trees IIGo71.8%mediumTree, Binary Search Tree, Dynamic Programming, Backtracking, Binary Tree
94Binary Tree Inorder TraversalGo75.8%easyStack, Tree, Depth-First Search, Binary Tree
88Merge Sorted ArrayGo52.2%easyArray, Two Pointers, Sorting
87Scramble StringGo48.2%hardString, Dynamic Programming
86Partition ListGo63.2%mediumLinked List, Two Pointers
85Maximal RectangleGo52.8%hardStack, Array, Dynamic Programming, Matrix, Monotonic Stack
83Remove Duplicates from Sorted ListGo53.6%easyLinked List
79Word Search❤️Go46.2%mediumArray, Backtracking, Matrix
78SubsetsGo80.5%mediumBit Manipulation, Array, Backtracking
76Minimum Window SubstringGo44.0%hardHash Table, String, Sliding Window
75Sort Colors❤️Go60.1%mediumArray, Two Pointers, Sorting
70Climbing Stairs❤️Go53.6%easyMemoization, Math, Dynamic Programming
69Sqrt(x)Go38.9%easyMath, Binary Search
67Add BinaryGo53.9%easyBit Manipulation, Math, String, Simulation
66Plus OneGo45.9%easyArray, Math
64Minimum Path SumGo69.2%mediumArray, Dynamic Programming, Matrix
62Unique PathsGo67.0%mediumMath, Dynamic Programming, Combinatorics
56Merge IntervalsGo48.4%mediumArray, Sorting
55Jump Game❤️Go43.5%mediumGreedy, Array, Dynamic Programming
53Maximum Subarray❤️Go54.9%easyArray, Divide and Conquer, Dynamic Programming
49Group AnagramsGo67.2%mediumHash Table, String, Sorting
48Rotate ImageGo74.0%mediumArray, Math, Matrix
46Permutations❤️Go78.5%mediumArray, Backtracking
39Combination Sum❤️Go72.8%mediumArray, Backtracking
38Count and SayGo59.9%mediumString
34Find First and Last Position of Element in Sorted ArrayGo42.2%mediumArray, Binary Search
33Search in Rotated Sorted ArrayGo43.5%mediumArray, Binary Search
31Next Permutation❤️Go37.5%mediumArray, Two Pointers
29Divide Two IntegersGo22.1%mediumBit Manipulation, Math
22Generate ParenthesesGo77.4%mediumString, Dynamic Programming, Backtracking
21Merge Two Sorted ListsGo66.7%easyRecursion, Linked List
20Valid Parentheses❤️Go44.5%easyStack, String
19Remove Nth Node From End of List❤️Go43.9%mediumLinked List, Two Pointers
17Letter Combinations of a Phone Number❤️Go57.7%mediumHash Table, String, Backtracking
153Sum❤️Go35.2%mediumArray, Two Pointers, Sorting
11Container With Most Water❤️Go61.5%mediumGreedy, Array, Two Pointers
6ZigZag ConversionGo51.9%mediumString
5Longest Palindromic Substring❤️Go, Rust36.5%mediumString, Dynamic Programming
3Longest Substring Without Repeating CharactersGo, Rust38.7%mediumHash Table, String, Sliding Window
2Add Two NumbersGo, Rust41.6%mediumRecursion, Linked List, Math
1Two SumGo, Rust52.5%easyArray, Hash Table