Skip to content

seigot/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

962 Commits
 
 

Repository files navigation

leetcode/NeetCode

for practice

Glind 75 (Frequent Asked Leetcode problem sets)
https://www.techinterviewhandbook.org/grind75/

NeetCode
https://neetcode.io/practice/practice/neetcode150


  • LeetCode Total solved url
    Dynamic Programming url
    --> 500+ solved, 0.5%
easy medium hard
148 413 190
easy medium hard
26/217 52/564 149/149

-- | - | - | url | |


NeetCode

No. 概要 url 備考
Paint House II A DP that uses the minimum and second minimum from the previous row for each house; define dp[i][c] as the minimum cost to paint houses 0..i with house i painted color c. url
Minimize Max Distance to Gas Station Heap(gap/parts)/Binary Search url
New 21 Game Probability DP with sliding window url
Integer Break Dynamic Programming url
Minimum Cost For Tickets Dynamic Programming url
Perfect Squares Dynamic Programming url
Combination Sum IV Dynamic Programming url
Triangle Dynamic Programming url
Partition Equal Subset Sum Dynamic Programming url
Longest Increasing Subsequence bisect right, list, longest increase subsequence url
Coin Change Dynamic Programming url
Word Break Dynamic Programming url
Maximum Product Subarray Dynamic Programming url
Decode Ways dp[i] represents the number of ways to decode the first i characters of the string. url
Palindromic Substrings Dynamic Programming url
Maximum Number of Points with Cost Dynamic Programming url
Minimum Path Sum Dynamic Programming url
Unique Paths II Dynamic Programming url
N-th Tribonacci Number Dynamic Programming url
Min Cost Climbing Stairs Dynamic Programming url
Climbing Stairs Dynamic Programming url
Interval DP, Substring DP, dp[i][j] represents whether substring is palindrome Dynamic Programming url
4 Keys Keyboard Dynamic Programming url
Paint Fence Dynamic Programming url
Paint House Dynamic Programming url
House Robber II Dynamic Programming + case split url
House Robber Dynamic Programming url
Coin Path Reverse DP / Path Reconstruction / lexicographical order as a tie-break url
Encode String with Shortest Length Interval DP with string pattern compression / optimal substructure url
Valid Palindrome III dp[i][j] = minimum deletions needed to make s[i:j+1] a palindrome url
Optimal Account Balancing DFS with backtracking and pruning url
Concatenated Words lexicographical, compare word[j:i] with DP url
Sparse Matrix Multiplication Process Matrix url
Lonely Pixel I Count, list url
Maximum Distance in Arrays O(n) url
Append Characters to String to Make Subsequence while/step by step comparison url
Rotate Array reserse 2 times url
4Sum 2-pointer approarch url
3Sum defaultdict url
Two Integer Sum II for loop, 2times url
String Compression Run-Length Encoding, RLE url
Logger Rate Limiter Dictionary url
Design Compressed String Iterator Offset url
Perform String Shifts Offset url
Counting Elements Cnt url
Palindrome Permutation collections,Counter url
Single-Row Keyboard defaultdict url
Number of Distinct Islands II DFS,BFS / Normalization(Sort, Transform) url
Maximum Number of Ones Count how much each cell contributes to the total number of ones url
Best Meeting Point mean / average url
Employee Free Time sort/greedy url
2416. Sum of Prefix Scores of Strings Tri-Tree url
Design Excel Sum Formula recursive call url
Time Taken to Cross the Door deque / state management / enter,exit url
2940. Find Building Where Alice and Bob Can Meet Heap/ url
1425. Constrained Subsequence Sum Dynamic Programming / Sliding Window Maximum url
2251. Number of Flowers in Full Bloom index compression/counter/set url
857. Minimum Cost to Hire K Workers heap/greedy url
1383. Maximum Performance of a Team heap/greedy url
1675. Minimize Deviation in Array heap/greedy url
1028. Recover a Tree From Preorder Traversal Tree/Traversal url
Subarrays with K Different Integers Sliding Window/Boundaries url
Number of Ships in a Rectangle Divide and Conquer (Quadtree) url
Moving Average from Data Stream class/list url
Is Subsequence 2-Pointers url
Intersection of Two Linked Lists 2loops in the lists url
Missing Number sum/O(1) url
Best Time to Buy and Sell Stock min/max/for url
Shortest Bridge Multi-Source-BFS url
Basic Calculator II Recursive url
Max Area of Island BFS url
Combination Sum II set(taple)/dynamic programming url
Course Schedule Toporogical sort url
Reorganize String Heap url
Merge Intervals Sort url
Number of Islands BFS/DFS url
Letter Combinations of a Phone Number BackTrack url
Design Circular Queue Circular Queue/EnQueue,DeQueue url
Longest Substring Without Repeating Characters Sliding Windows url
Design Tic-Tac-Toe Brute Force url
Minimum Knight Moves BFS url
Meeting Rooms II Event Sort(座標圧縮) url
Serialize and Deserialize N-ary Tree DFS/Deserialize,serialize** url
Maximum Average Subarray II Binary Search /Average-to-Sum Transformation/Offset Values/Accumulated Sum url
The Maze III Dijkstra/Heap/Dict Structure** url
Basic Calculator III Caluculation(+-*/()/Stack,Recursion) url
Bus Routes Node Management/BFS on a dual-layer graph, prioritizing routes as nodes to reduce search space. url
Split Array With Same Average A bitset-optimized dynamic programming approach to solve the Subset Sum Problem.** url
Design Search Autocomplete System Tri-Tree/Search Autocomplete text url
Closest Binary Search Tree Value II Two-Stack BST Iterator/Binary Search url
Divide Chocolate Binary Search/Greedy Check url
Maximum Profit in Job Scheduling DP with Binary Search url
Max Stack Heap/Lazy Removal url
Rearrange String k Distance Apart Greedy with Cooling Queue/Greedy Approach using Max-Priority Queue and Deque url
Text Justification Greedy Word Packing/Greedy Round-robin space distribution url
Put Marbles in Bags Adjacent Pair Sum Maximization/Minimization url
Design In-Memory File System Tri-Tree url
Cherry Pickup Synchronized Two-Player Pathfinding url
Minimum Number of Increments on Subarrays to Form a Target Array brute_force/increment url
Russian Doll Envelopes sort/bisect url
K-th Smallest in Lexicographical Order Calculate k-th smallest number with the subtree strategy url
Shortest Distance from All Buildings BFS/manage the distance from each buildings url
Number of Visible People in a Queue Monotonic-Stack url
Number of Islands II Union-Find url
Greatest Common Divisor Traversal Prime Factorization, Union-Find url
Build a Matrix With Conditions Topological sort, row*col url
Find Critical and Pseudo Critical Edges in Minimum Spanning Tree Graph Critical/Pseudo Critical Edges/UnionFind+Sort url
Alien Dictionary BFS / Kahn's Algorithm, toporogical sort url
Swim in Rising Water Binary Search+BFS/Dijkstra url
Distinct Subsequences Dynamic Programming url
Burst Balloons Top-down Dynamic Programming with Memoization url
Regular Expression Matching DP url
Minimum Interval to Include Each Query heap/sort url
Meeting Rooms III heap url
Word Break II DP url
N-Queens II BFS url
First Missing Positive swap,O(n) url
Meeting Rooms III manage used,available with heapq url
Candy brute force algorithm url
Longest Increasing Path in Matrix BFS, calculate the contributed value url
Stone Game III dp, bottom up url
Reconstruct Flight Path stack,pop,dfs url
Word Ladder BFS url
Word Search II Trie Tree url
N-Queens Recursive, (r,c) url
IPO Project, Heap(log(N)) url
Find Median From Data Stream 2 heaps url
Serialize and Deserialize Binary Tree Tree, Search url
Binary Tree Maximum Path Sum Tree, recursive, Accumulate the contributions url
Reverse Nodes in K-Group Linked Lists/Recursive,reverse url
Merge K Sorted Linked Lists Linked Lists url
LFU Cache Least Frequency Used Cache/OrderedDict url
Find in Mountain Array Binary Search url
Median of Two Sorted Arrays Binary search/left,right array url
Split Array Largest Sum Binary Search url
Largest Rectangle In Histogram Check the high,low value/for url
Maximum Frequency Stack manage stack value url
Sliding Window Maximum Put the maximum num in the front of que always url
Minimum Window Substring Window Search, based on r url
Trapping Rain Water 2 pointer url
Two Sum for url
Valid Anagram sort url
Contains Duplicate set url
Longest Consecutive Sequence set url
Valid Sudoku for url
Products of Array Except Self accumulated sum url
Encode and Decode Strings special charactor url
Top K Frequent Elements freq url
Group Anagrams compare the orger of strings url

LeetCode

No. 概要 url 備考
1147. Longest Chunked Palindrome Decomposition dfs url
1125. Smallest Sufficient Team Bit DP url
1301. Number of Paths with Max Score 2D DP url
1278. Palindrome Partitioning III Interval DP url
1312. Minimum Insertion Steps to Make a String Palindrome Interval DP url
3739. Count Subarrays With Majority Element II Fenwick Tree url
3020. Find the Maximum Number of Elements in Subset Greedy + Counter url
1846. Maximum Element After Decreasing and Rearranging sort url
3020. Find the Maximum Number of Elements in Subset count url
1833. Maximum Ice Cream Bars sort url
1189. Maximum Number of Balloons defaultdict url
1840. Maximum Building Height Compute the maximum height between restriction points. url
1732. Find the Highest Altitude max(),gain url
1344. Angle Between Hands of a Clock Transform from minutes to angle url
2095. Delete the Middle Node of a Linked List fast,slow pointer url
1000. Minimum Cost to Merge Stones Interval DP url
960. Delete Columns to Make Sorted III 2strings, dp url
964. Least Operators to Express Number dp,Digit DP on the base-x representation. url
968. Binary Tree Cameras dfs, dp url
975. Odd Even Jump odd,even,dp url
996. Number of Squareful Arrays squared, bfs, Counter url
3838. Weighted Word Mapping ord('a'),chr('a'),for,mod url
2130. Maximum Twin Sum of a Linked List LinkedList url
3559. Number of Ways to Assign Edge Weights II BFS / dp url
3558. Number of Ways to Assign Edge Weights I BFS url
2161. Partition Array According to Given Pivot list url
956. Tallest Billboard Difference DP url
943. Find the Shortest Superstring string / BitDP / brute force url
3753. Total Waviness of Numbers in Range II BitDP url
2574. Left and Right Sum Differences sum url
3635. Earliest Finish Time for Land and Water Rides II Prefix,Suffix / BinarySearch url
903. Valid Permutations for DI Sequence DP / rank url
913. Cat and Mouse DP / Backward Propagation of Game Outcomes url
940. Distinct Subsequences II DP url
887. Super Egg Drop Inverse DP / Reverse DP url
902. Numbers At Most N Given Digit Set digit DP url
871. Minimum Number of Refueling Stops greedy / heapq url
834. Sum of Distances in Tree Tree / Re-rooting DP url
847. Shortest Path Visiting All Nodes BFS / bitMask url
828. Count Unique Characters of All Substrings of a Given String Count contributions url
818. Race Car DP / 2 patterns url
2126. Destroying Asteroids sort url
688. Knight Probability in Chessboard dp / probability url
678. Valid Parenthesis String dp / O(n) url
673. Number of Longest Increasing Subsequence dp / LIS url
650. 2 Keys Keyboard dp / prime factorization url
3161. Block Placement Queries update only the portions affected by inserting a new obstacle url
741. Cherry Pickup DP url
801. Minimum Swaps To Make Sequences Increasing DP url
3093. Longest Common Suffix Queries Tri Tree url
664. Strange Printer interval DP / dfs url
730. Count Different Palindromic Subsequences interval DP url
600. Non-negative Integers without Consecutive Ones Digit D+ Fibonacci url
639. Decode Ways II 2 types of transition url
3120. Count the Number of Special Characters I defaultdict / c.lower url
472. Concatenated Words DP / consecutive word[j:i] url
647. Palindromic Substrings Expand Around Center url
458. Poor Pigs state url
466. Count The Repetitions Repeated subsequence matching with cycle detection url
472. Concatenated Words Word Break DP url
410. Split Array Largest Sum binary search url
403. Frog Jump DP with reachable jump sizes per stone, Jump forward url
354. Russian Doll Envelopes sort+Longest Increasing Subsequence url
329. Longest Increasing Path in a Matrix Topological DP url
312. Burst Balloons Interval DP url
233. Number of Digit One Digit Counting (count the number of 1s at each place value) url
188. Best Time to Buy and Sell Stock IV Dynamic Programming (Transaction-based State DP) url
174. Dungeon Game # Define dp[i][j] as the minimum HP required when entering room (i, j), then compute it in reverse order. url
140. Word Break II dp[] / dp[i] = all valid sentences that can form s[:i] (the first i characters url
132. Palindrome Partitioning II palindrome[j][i] / dp url
123. Best Time to Buy and Sell Stock III dp / accumlated sum url
115. Distinct Subsequences dp, string from backward url
87. Scramble String recursive call url
44. Wildcard Matching dp, string url
10. Regular Expression Matching dp, 2 dimension url
32. Longest Valid Parentheses stack url
646. Maximum Length of Pair Chain greedy chain url
638. Shopping Offers DFS with Memoization url
583. Delete Operation for Two Strings lcs url
576. Out of Boundary Paths BFS url
553. Optimal Division O(1) url
1340. Jump Game V dfs url
526. Beautiful Arrangement bitmask DP url
518. Coin Change II Unbounded Knapsack DP url
516. Longest Palindromic Subsequence Interval DP url
486. Predict the Winner MinMax url
473. Matchsticks to Square Bitmask DP url
464. Can I Win Minimax + DFS + Memoization url
467. Unique Substrings in Wraparound String dp/unique subsequence number url
413. Arithmetic Slices greedy url
397. Integer Replacement greedy url
375. Guess Number Higher or Lower II Interval DP / Minimax Interval DP url
357. Count Numbers with Unique Digits brute foece url
343. Integer Break dp/dp[i] = the maximum product that can be obtained by breaking integer i into smaller url
337. House Robber III tree dp/ rob,not rob url
279. Perfect Squares dp/the number of value to consist of the target number. url
3043. Find the Length of the Longest Common Prefix set()/brute force url
313. Super Ugly Number greedy url
309. Best Time to Buy and Sell Stock with Cooldown greedy url
264. Ugly Number II original/Triple pointer url
241. Different Ways to Add Parentheses dfs/defaultdict url
213. House Robber II dp (2 types of search) url
131. Palindrome Partitioning bitmask brute-force url
122. Best Time to Buy and Sell Stock II Greedy/buy,sell url
97. Interleaving String 2dimention, dp() url
96. Unique Binary Search Trees BST, dp() url
2657. Find the Prefix Common Array of Two Arrays defaultdict() url
2540. Minimum Common Value set() url
1345. Jump Game IV BFS/Set() url
95. Unique Binary Search Trees II Binary Tree / Recursive function url
72. Edit Distance Dynamic Programming (DP) in 2 dimensions / string url
64. Minimum Path Sum Dynamic Programming (DP) in 2 dimensions url
63. Unique Paths II Dynamic Programming (DP) in 2 dimensions url
45. Jump Game II dp url
1306. Jump Game III Breadth-First Search (BFS) url
154. Find Minimum in Rotated Sorted Array II binary search + duplicate/worst case O(n) url
1665. Minimum Initial Energy to Finish Tasks Sort the tasks in order of higher starting requirements but lower energy consumption. url
1674. Minimum Moves to Make Array Complementary differencial array url
153. Find Minimum in Rotated Sorted Array binary search url
2784. Check if Array is Good for / if url
2553. Separate the Digits in an Array Convert an integer to a string url
1025. Divisor Game practice dp / If opponent loses at dp[i-x], current player can force a win url
1668. Maximum Repeating Substring practice dp url
1137. N-th Tribonacci Number practice dp url
746. Min Cost Climbing Stairs practice dp url
509. Fibonacci Number practice dp url
392. Is Subsequence practice dp url
338. Counting Bits practice dp url
121. Best Time to Buy and Sell Stock practice dp url
119. Pascal's Triangle II practice dp url
70. Climbing Stairs practice dp url
1914. Cyclically Rotating a Grid BruteForce url
3629. Minimum Jumps to Reach End via Prime Teleportation Prime/BFS url
3660. Jump Game IX Prefix Maximum/suffix minimum url
1861. Rotating the Box Right-->Left Greedy, algorithm/two-pointer simulation url
796. Rotate String Doubling url
1722. Minimize Hamming Distance After Swap Operations Union Find / Counter url
2452. Words Within Two Edits of Dictionary brute force / simulation / string comparison url
2615. Sum of Distances Manage the difference url
788. Rotated Digits Brute force/Greedy url
396. Rotate Function state transition url
3742. Maximum Path Score in a Grid dp[j][i][cost]=score url
2033. Minimum Operations to Make a Uni-Value Grid median / mod url
1391. Check if There is a Valid Path in a Grid BFS/Directional Connection url
1559. Detect Cycles in 2D Grid BFS/Loop Detection url
2833. Furthest Point From Origin count url
2078. Two Furthest Houses With Different Colors for/abs url
3225. Maximum Score From Grid Operations Column Height DP + Prefix Sum + Prefix/Suffix Optimization ** url
3464. Maximize the Distance Between Points on a Square Linearization + Binary Search + Greedy Check + Circular Validation url
1855. Maximum Distance Between a Pair of Values double pointer url
2463. Minimum Total Distance Traveled DP:Dynamic Programming with ordered assignment (sequence DP) url
3488. Closest Equal Element Queries precalculation/bisect_left url
3761. Minimum Absolute Distance Between Mirror Pairs reverse/str[::-1]/dp url
3783. Mirror Distance of an Integer reverse/str[::-1] url
2515. Shortest Distance to Target String in a Circular Array doubling url
1848. Minimum Distance to the Target Element for/if url
514. Freedom Trail A shortest-path problem that minimizes the sum of rotation cost and future cost; define dp(i, cur) as the minimum number of steps to spell key[i:] when the ring’s index cur is aligned at 12:00. url
1289. Minimum Falling Path Sum II DP: prev[j]: the minimum path sum ending at column j up to the previous row; store min1 and min2 (the smallest and second smallest values). url
1463. Cherry Pickup II DP: 3D dynamic programming (DP) with memoization over two robot positions, dp(r, c1, c2) means: the maximum number of cherries collectable from row r onward, when robot 1 is at column c1 and robot 2 is at column c2. url
446. Arithmetic Slices II - Subsequence DP: Use DP with hash maps to count arithmetic subsequences by extending previous sequences with the same difference. url
629. K Inverse Pairs Array DP: Use prefix-sum optimized DP to count ways of forming exactly k inverse pairs by inserting each number into all possible positions. url
1335. Minimum Difficulty of a Job Schedule Interval DP that exhaustively tries all partition points, splitting from the front to minimize the maximum job difficulty of each day. url
1531. String Compression II DP:For each segment, it exhaustively compares all possibilities of forming it into a run while deleting the remaining characters.** url
1269. Number of Ways to Stay in the Same Place After Some Steps** DP: At each step, update the number of ways to stay at each index (pos), where dp[pos] represents the number of ways to be at position pos after the current number of steps.** url
2742. Painting the Walls DP: paying for wall i covers 1 + time[i] walls in total, so choose the cheapest set of paid walls. url
1547. Minimum Cost to Cut a Stick Interval DP: try every possible first cut and minimize total cost url
1639. Number of Ways to Form a Target String Given a Dictionary DP/A DP that builds the target from left to right using character frequencies per column url
879. Profitable Schemes DP/Knapsack url
2218. Maximum Value of K Coins From Piles DP/The last k songs are all distinct url
920. Number of Music Playlists DP/The last k songs are all distinct url
874. Walking Robot Simulation Step move/If/while url
2069. Walking Robot Simulation II Step move/If/while url
3741. Minimum Distance Between Three Equal Elements II Sliding window on grouped indices url
3655. XOR After Range Multiplication Queries II DP/Square root decomposition + residue class partitioning + multiplicative difference array url
1866. Number of Ways to Rearrange Sticks With K Sticks Visible DP/Split by the largest element (n) url
1220. Count Vowels Permutation DP/Strings count url
1092. Shortest Common Supersequence DP/lcs/recovery url
552. Student Attendance Record II DP/l*a state transition url
689. Maximum Sum of 3 Non-Overlapping Subarrays Precalculation url
657. Robot Return to Origin basic url
1964. Find the Longest Valid Obstacle Course at Each Position bisect/list.append()/DP url
1964. Find the Longest Valid Obstacle Course at Each Position DP/strictly increasing subsequence url
1799. Maximize Score After N Operations dfs/@lru_cache(None) url
2075. Decode the Slanted Ciphertext row/col url
3661. Maximum Walls Destroyed by Robots sort/DP(left->right,right->left,left->left,right->right) url
3418. Maximum Amount of Money Robot Can Earn DP/for url
3474. Lexicographically Smallest Generated String DP/KMP/greedy** url
2751. Robot Collisions DP/sort url
2840. Check if Strings Can be Made Equal With Operations II defaultdict url
691. Stickers to Spell Word DFS/lru_cache url
2493. Divide Nodes Into the Maximum Number of Groups BFS/Graph Traversal url
3203. Find Minimum Diameter After Merging Two Trees Tree, radius/radius url
2045. Second Minimum Time to Reach Destination Minimum/Second Minumum url
1568. Minimum Number of Days to Disconnect Island Graph/Connected url
1579. Remove Max Number of Edges to Keep Graph Fully Traversable UnionFind for 2 url
2839. Check if Strings Can be Made Equal With Operations I defaultdict url
2127. Maximum Employees to Be Invited to a Meeting Functional Graph/longest chain, cyclic detection url
2421. Number of Good Paths Unionfind url
3108. Minimum Cost Walk in Weighted Graph And/UnionFind(union,find)/list url
827. Making A Large Island BFS/Set url
2577. Minimum Time to Visit a Cell In a Grid Dijkstra/Mininum dist update url
2573. Find the String with LCP DP/LCP url
3548. Equal Sum Grid Partition II Defaultdict/Sum url
2946. Matrix Similarity After Cyclic Shifts shift url
3546. Equal Sum Grid Partition I sum() url
2906. Construct Product Matrix prefix/suffix url
1594. Maximum Non Negative Product in a Matrix dp(max,min) url
1886. Determine Whether Matrix Can Be Obtained By Rotation 90 Degree rotation url
2050. Parallel Courses III topological sort/dp url
2092. Find All People With Secret BFS/sort/set() url
1553. Minimum Number of Days to Eat N Oranges Memoized Recursion url
1857. Largest Color Value in a Directed Graph BFS/Topological sort/DP url
3643. Flip Square Submatrix Vertically Greedy url
3567. Minimum Absolute Difference in Sliding Submatrix set/sort url
3212. Count Submatrices With Equal Frequency of X and Y submatrices/Accumulated-Sum url
3070. Count Submatrices with Top-Left Element and Sum Less Than k Accumulated-Sum url
1727. Largest Submatrix With Rearrangements sort/Create a histogram using each row as the base, then rearrange the columns to find the largest rectangle. url
773. Sliding Puzzle Brute Force/All state search/BFS url
2872. Maximum Number of K-Divisible Components BFS from EdgeNote url
1622. Fancy Sequence Lazy Linear Transformation/segment tree lazy propagation/inverse url
1878. Get Biggest Three Rhombus Sums in a Grid Brute Force/Greedy url
1415. The k-th Lexicographical String of All Happy Strings of Length n Recursive/reverse/k-th url
149. Max Points on a Line Slope / Slope normalization / Reduced fraction / Greatest common divisor url
273. Integer to English Words Recursive/Helper function url
1611. Minimum One Bit Operations to Make Integers Zero Bit Operation/Recursive Process url
3600. Maximize Spanning Tree Stability with Upgrades binary search/union find/Spanning Tree url
3130. Find All Possible Stable Binary Arrays II dynamic programming url
3296. Minimum Number of Seconds to Make Mountain Height Zero Binary Search/quadratic formula url
1009. Complement of Base 10 Integer bit flip/reverse,join(),map(str,l),int(x,2) url
352. Data Stream as Disjoint Intervals count numerical continuous length url
1980. Find Unique Binary String Brute force url
2818. Apply Operations to Maximize Score greedy/Count candidate and greedy url
3068. Find the Maximum Sum of Node Values greedy/xor url
1793. Maximum Score of a Good Subarray greedy/left,right,expansion based on k url
995. Minimum Number of K Consecutive Bit Flips greedy url
1368. Minimum Cost to Make at Least One Valid Path in a Grid 0-1 BFS url
2503. Maximum Number of Points From Grid Queries Heap/BFS url
3045. Count Prefix and Suffix Pairs II Tri-Tree,border/KMP/Trie** url
1255. Maximum Score Words Formed by Letters backtracking/Bitmask Enumeration/Counter url
1888. Minimum Number of Flips to Make the Binary String Alternating rotate string/String Doubling url
1784. Check if Binary String Has at Most One Segment of Ones Count Continuous Sequences url
1758. Minimum Changes To Make Alternating Binary String compare binary strings url
1582. Special Positions in a Binary Matrix Matrix Search url
1545. Find Kth Bit in Nth Binary String Recursive Search url
1536. Minimum Swaps to Arrange a Binary Grid swap/greedy inseartion sort url
1689. Partitioning Into Minimum Number Of Deci-Binary Numbers int()/max() url
3666. Minimum Operations to Equalize Binary String Solved heuristic count url
1680. Concatenation of Consecutive Binary Numbers bit operation url
1404. Number of Steps to Reduce a Number in Binary Representation to One int(s,2)/divide,mod url
1 Bits sort/tuple() url
1022. Sum of Root To Leaf Binary Numbers dfs/binary operation url
1461. Check If a String Contains All Binary Codes of Size K Sliding Window url
868. Binary Gap Binary translation / max() url
761. Special Binary String Divide and Conquer / Recursion / Greedy Algorithm url
762. Prime Number of Set Bits in Binary Representation Bit Operation url
696. Count Binary Substrings Count number url
693. Binary Number with Alternating Bits Bit Operation url
401. Binary Watch Bit Operation, BruteForce, bin(h) transfer url
190. Reverse Bits Bit Operation/Divide,Remainder/Modulus url
67. Add Binary While/i,j,iterator/carry url
3714. Longest Balanced Substring II Prefix Sum / Cumulative Difference / State Matching url
799. Champagne Tower Simulate all cases url
3713. Longest Balanced Substring I Constraint-based Search url
3721. Longest Balanced Subarray II Segment Tree url
3719. Longest Balanced Subarray I Brute force url
686. Repeated String Match Boyer–Moore/Pattern Matching url
1044. Longest Duplicate Substring Rabin-Karp/Rolling Hash url
28. Find the Index of the First Occurrence in a String String Compare url
1382. Balance a Binary Search Tree Balance a Binary Search Tree/Recursive Tree Construction url
110. Balanced Binary Tree Recursive url
719. Find K-th Smallest Pair Distance Binary Search / Sliding Window url
726. Number of Atoms Stack / Hierarchical deque structure url
1106. Parsing A Boolean Expression Stack-based nested expression parsing from ")". url
862. Shortest Subarray with Sum at Least K Prefix Sum / Deque url
2751. Robot Collisions Stack/O(n) url
632. Smallest Range Covering Elements from K Lists Sliding Window/count unique_lists_in_window url
2009. Minimum Number of Operations to Make Array Continuous Sord/Sliding Windows url
2306. Naming a Company Set Difference of First Letters / Counting Duplicates url
1074. Number of Submatrices That Sum to Target Accumulated Sum url
214. Shortest Palindrome KMP法(Knuth-Morris-Pratt Algorithm) Table url
1653. Minimum Deletions to Make String Balanced Dynamic Programming url
3634. Minimum Removals to Balance Array Binary Search url
3379. Transformed Array Index Control. url
3640. Trionic Array II DP(Use the cumulative sums of increasing and decreasing sequences as DP states.) url
3637. Trionic Array I Brute Force url
3013. Divide an Array Into Subarrays With Minimum Cost II Sliding Window K-Minimum Sum/SortedList() url
407. Trapping Rain Water II Heap/BFS url
2290. Minimum Obstacle Removal to Reach Corner 0-1BFS url
3010. Divide an Array Into Subarrays With Minimum Cost I sort url
2977. Minimum Cost to Convert String II Graph/Dijkstra/Tri-Tree/DP url
2976. Minimum Cost to Convert String I Floyd-Warshall url
744. Find Smallest Letter Greater Than Target for/if url
3651. Minimum Cost Path with Teleportations Dynamic Programming with monotone teleportation updates/not dijkstra's algorithm url
3650. Minimum Cost Path with Edge Reversals dijkstra's algorithm url
1200. Minimum Absolute Difference sort/min url
1984. Minimum Difference Between Highest and Lowest of K Scores sort url
1877. Minimize Maximum Pair Sum in Array Greedy Search/Sort url
3510. Minimum Pair Removal to Sort Array II Greedy Algorithm/Min-Priority Queue/Doubly Linked List/Two Pointers Technique** url
3507. Minimum Pair Removal to Sort Array I Lazy Update in Heap url
3315. Construct the Minimum Bitwise Array II Bit calculation url
3314. Construct the Minimum Bitwise Array I Bit calculation url
1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold Greedy/Monotonic Improvement, 2D Prefix Sum url
1895. Largest Magic Square Accumlated Sum/Brute force url
3454. Separate Squares II Solved Segment Tree** url
3047. Find the Largest Area of Square Inside Two Rectangles Greedy/Combinations url
2975. Maximum Square Area by Removing Fences From a Field Greedy/Combinations url
2943. Maximize Area of Square Hole in Grid Greedy url
3453. Separate Squares I Binary Search url
1266. Minimum Time Visiting All Points the Chebyshev distances url
85. Maximal Rectangle Calculating the 'Maximum Expansion' for each cell. url
1458. Max Dot Product of Two Subsequences DP/SubSequences url
712. Minimum ASCII Delete Sum for Two Strings DP/2dimentions url
865. Smallest Subtree with all the Deepest Nodes DFS/Depth Search url
1339. Maximum Product of Splitted Binary Tree Total - SubTree url
1161. Maximum Level Sum of a Binary Tree Broaden First Search url
1975. Maximum Matrix Sum Brute Force url
1390. Four Divisors Sieve of Eratosthenes url
1970. Last Day Where You Can Still Cross binary search/bfs url
961. N-Repeated Element in Size 2N Array set/defaultdict url
66. Plus One for/digit/add url
840. Magic Squares In Grid Brute Force url
756. Pyramid Transition Matrix DFS/BFS url
1351. Count Negative Numbers in a Sorted Matrix for url
2483. Minimum Penalty for a Shop brute force url
3075. Maximize Happiness of Selected Children sort/for url
3074. Apple Redistribution into Boxes sort url
2054. Two Best Non-Overlapping Events Sort/Binary Search url
955. Delete Columns to Make Sorted II compare the orger of strings url
3652. Best Time to Buy and Sell Stock using Strategy sliding window(manage positive,negative) url
944. Delete Columns to Make Sorted row/col url
3573. Best Time to Buy and Sell Stock V Dynamic Programming url
2110. Number of Smooth Descent Periods of a Stock Dynamic Programming url
227. Basic Calculator II Basic Operation / plug translation url
153. Find Minimum in Rotated Sorted Array binary search url
61. Rotate List List, Head/Tail url
16. 3Sum Closest Double Pointer algorithm url
863. All Nodes Distance K in Binary Tree adjacent list/bfs url
787. Cheapest Flights Within K Stops djkstra algorithm url
73. Set Matrix Zeroes matrix processing url
7. Reverse Integer reverse url
91. Decode Ways Dynamic Programming url
179. Largest Number compare_func, custom sort url
74. Search a 2D Matrix binary search url
50. Pow(x, n) Binary Exponentiation url
437. Path Sum III DFS/prefix_sum url
143. Reorder List reverse url
103. Binary Tree Zigzag Level Order Traversal Binary Tree url
48. Rotate Image rotate url
221. Maximal Square dynamic programming url
215. Kth Largest Element in an Array heapreplace, heappop()/heappush() url
528. Random Pick with Weight rand() url
735. Asteroid Collision stack, pop/append url
3433. Count Mentions Per User Message Data Processing url
3606. Coupon Code Validator isalnum url
3531. Count Covered Buildings Check each maximum building blocks url
3577. Count the Number of Computer Unlocking Permutations Check the problen condition carefully url
3583. Count Special Triplets Counter/Counting from the middle url
435. Non-overlapping Intervals sort/brute force url
380. Insert Delete GetRandom O(1) insert/delete/hashmap url
377. Combination Sum IV Dynamic Programming url
560. Subarray Sum Equals K accumlated sums/defaultdict url
1925. Count Square Sum Triples Count Sum Triples url
148. Sort List merge sort url
22. Generate Parentheses BFS url
662. Maximum Width of Binary Tree binary tree/calculate index on TreeNode url
658. Find K Closest Elements Binary search/Sliding window url
424. Longest Repeating Character Replacement Sliding window search url
55. Jump Game Greedy url
300. Longest Increasing Subsequence bisect()/optimization url
210. Course Schedule II toporogical Sort/BFS url
24. Swap Nodes in Pairs 2 pointer url
113. Path Sum II BFS/DFS url
128. Longest Consecutive Sequence hash set url
189. Rotate Array reverse url
328. Odd Even Linked List Pointer url
394. Decode String encode/decode/stack url
525. Contiguous Array window search/memory left side url
1523. Count Odd Numbers in an Interval Range Odd url
3578. Count Partitions With Max-Min Difference at Most K DP/Sliding window url
3432. Count Partitions with Even Sum Difference Count/Brute Force url
2211. Count Collisions on a Road Simplify the problem url
3623. Count Number of Trapezoids I the number of horizontal trapezoids/sum url
1590. Make Sum Divisible by P mod/subarray url
230. Kth Smallest Element in a BST binary tree url
739. Daily Temperatures monotonic stack url
198. House Robber Dynamic Programming url
134. Gas Station greedy url
31. Next Permutation Find next permutation url
36. Valid Sudoku set/for url
49. Group Anagrams dictionaly/set/append url
152. Maximum Product Subarray Dynamic Programming/keep both max and min valude. url
211. Design Add and Search Words Data Structure Trie Tree/Data structure for String Search url
417. Pacific Atlantic Water Flow set.intersection()/bfs url
287. Find the Duplicate Number binary search url
19. Remove Nth Node From End of List LinkedList url
692. Top K Frequent Words Counter/Heap url
146. LRU Cache HashList/Queue url
621. Task Scheduler Greedy Algorithm url
310. Minimum Height Trees Tree/Extract leave url
438. Find All Anagrams in a String Window Search url
79. Word Search dfs url
17. Letter Combinations of a Phone Number Combination/BFS,DFS url
11. Container With Most Water Two pointer approach url
3381. Maximum Subarray Sum With Length Divisible by K dynamic programming url
76. Minimum Window Substring two pointer approach url
297. Serialize and Deserialize Binary Tree serialize/deserialize url
42. Trapping Rain Water pre-calculation url
295. Find Median from Data Stream heap/control two heap url
127. Word Ladder bfs, word distance url
224. Basic Calculator stack/while/calculation url
105. Construct Binary Tree from Preorder and Inorder Traversal - url
62. Unique Paths dynamic programming/bfs url
199. Binary Tree Right Side View bfs, binary tree url
78. Subsets bfs, list url
54. Spiral Matrix matrix control url
8. String to Integer (atoi) atoi url
416. Partition Equal Subset Sum dynamic programming url
139. Word Break dynamic programming url
757. Set Intersection Size At Least Two greedy url
2435. Paths in Matrix Whose Sum Is Divisible by K dynamic programming url
1015. Smallest Integer Divisible by K Repunit Number url
1018. Binary Prefix Divisible By 5 binary, bit operation url
1262. Greatest Sum Divisible by Three dynamic programming url
3190. Find Minimum Operations to Make All Elements Divisible by Three mod 3 url
1930. Unique Length-3 Palindromic Subsequences set/greedy search url
2154. Keep Multiplying Found Values by Two Solved while url
717. 1-bit and 2-bit Characters flag url
1437. Check If All 1's Are at Least Length K Places Away count the number of zeros. url
1513. Number of Substrings With Only 1s count the number of coutinuous ones. url
1235. Maximum Profit in Job Scheduling binary search/ url
23. Merge k Sorted Lists priority queue url
84. Largest Rectangle in Histogram Height management/dynamic programming url
124. Binary Tree Maximum Path Sum Solved Recursive DFS url
895. Maximum Frequency Stack stack/defaultdict(manage frequency of the numbers.) url
39. Combination Sum BFS/backtrack/DP url
33. Search in Rotated Sorted Array binary-search url
46. Permutations backtracking url
56. Merge Intervals list url
236. Lowest Common Ancestor of a Binary Tree Lowest Common Ancestor url
981. Time Based Key-Value Store set()/list url
75. Sort Colors sort() url
2536. Increment Submatrices by One 2D Difference Array url
3228. Maximum Number of Operations to Move Ones to the End Dynamic Programming url
3234. Count the Number of Substrings With Dominant Ones pre-processing/calc 0(1) url
2654. Minimum Number of Operations to Make All Array Elements Equal to 1 GCD url
994. Rotting Oranges Broden First Search url
200. Number of Islands Union-Find url
98. Validate Binary Search Tree Node, Class url
155. Min Stack manage the current/current minumum value url
238. Product of Array Except Self product calculations url
322. Coin Change dynamic programming url
208. Implement Trie (Prefix Tree) Class/Tree url
207. Course Schedule Topological Sorting url
474. Ones and Zeroes knapsack problem url
150. Evaluate Reverse Polish Notation Reverse Polish Notation (RPN) url
133. Clone Graph graph/broden first search url
102. Binary Tree Level Order Traversal list/broden first search url
15. 3Sum 2 pointer url
973. K Closest Points to Origin sort/square url
542. 01 Matrix broden first search url
57. Insert Interval while/range url
53. Maximum Subarray kanade-algorithm,dynamic programming url
12. Integer to Roman while/divide/''.join(result) url
8. String to Integer (atoi) atoi/while/pre-processing url
7. Reverse Integer reverse number url
6. Zigzag Conversion zigzag/list/index control url
5. Longest Palindromic Substring expand_around_center url
3. Longest Substring Without Repeating Characters window search url
2. Add Two Numbers listNode/Linkedlist/class url
3542. Minimum Operations to Convert All Elements to Zero Monotonic stack url
2169. Count Operations to Obtain Zero substruction url
3321. Find X-Sum of All K-Long Subarrays II defaultdict/window search/sortedlist url
2528. Maximize the Minimum Powered City Window search/binary search/diff matrix url
1611. Minimum One Bit Operations to Make Integers Zero minimumOneBitOperations/GrayCode url
3607. Power Grid Maintenance union-find/sorted list(sortedlist.add(),sortedlist.remove(),sortedlist[0]) url
3318. Find X-Sum of All K-Long Subarrays I brute force url
1578. Minimum Time to Make Rope Colorful brute force url
1526. Minimum Number of Increments on Subarrays to Form a Target Array focus on diff url
2257. Count Unguarded Cells in the Grid broden first search url
3217. Delete Nodes From Linked List Present in Array linked list url
3289. The Two Sneaky Numbers of Digitville set url
3370. Smallest Number With All Set Bits n.bit_length() url
3354. Make Array Elements Equal to Zero simulate url
2125. Number of Laser Beams in a Bank list url
2043. Simple Bank System class/error check url
2048. Next Greater Numerically Balanced Number brute force url
3461. Check If Digits Are Equal in String After Operations I sum/mod url
3346. Maximum Frequency of an Element After Performing Operations I sort/binary search url
2011. Final Value of Variable After Performing Operations pattern match url
1625. Lexicographically Smallest String After Applying Operations brute force/BFS url
3397. Maximum Number of Distinct Elements After Operations sort/min/max url
2598. Smallest Missing Non-negative Integer After Operations mex/modulo operation url
3350. Adjacent Increasing Subarrays Detection II pre-calculate url
3349. Adjacent Increasing Subarrays Detection I list/for url
2273. Find Resultant Array After Removing Anagrams set()/string() url
3186. Maximum Total Damage With Spell Casting dynamic programming url
3147. Taking Maximum Energy From the Mystic Dungeon dynamic programming/reverse way url
3494. Find the Minimum Amount of Time to Brew Potions accumulated sum/simulate,calculate the earliest start time. url
2300. Successful Pairs of Spells and Potions bisect url
1488. Avoid Flood in The City bisect/list/set/brute force url
778. Swim in Rising Water Modified Dijkstra's Algorithm url
11. Container With Most Water two pointer approach (Greedy Two Pointers Algorithm) url
3100. Water Bottles II caluculate division/while url
1518. Water Bottles caluculate division url
2221. Find Triangular Sum of an Array dynamic programming url
1039. Minimum Score Triangulation of Polygon Interval Dynamic Programming url
976. Largest Perimeter Triangle Perimeter of Triangle url
812. Largest Triangle Area brute force/area of triangle(Surveyor's Formula) url
611. Valid Triangle Number sort/brute force search url
120. Triangle DP (The bottom-up approach) url
166. Fraction to Recurring Decimal/long division - url
165. Compare Version Numbers char.split()/int() url
3005. Count Elements With Maximum Frequency defaultdict url
1912. Design Movie Rental System heap()/sort()/defaultdict(list) url
3508. Implement Router defaultdict(list)/binary_search() url
3484. Design Spreadsheet dict()/string.sprit() url
3408. Design Task Manager heap() url
2197. Replace Non-Coprime Numbers in Array heap()/latest value management url
1935. Maximum Number of Words You Can Type set()/charactor url
966. Vowel Spellchecker pattern matching url
3227. Vowels Game in a String greedy url
2785. Sort Vowels in a String vowels/consonent/sort url
1733. Minimum Number of People to Teach set/min/greedy or brute force approach url
3541. Find Most Frequent Vowel and Consonant set url
2327. Number of People Aware of a Secret dp url
1317. Convert Integer to the Sum of Two No-Zero Integers for/brute force url
1304. Find N Unique Integers Sum up to Zero for url
3495. Minimum Operations to Make Array Elements Zero min url
2749. Minimum Operations to Make the Integer Zero bit operation/formulate url
3516. Find Closest Person absolute value url
3027. Find the Number of Ways to Place People II sort[x Ascending order,y Descending order]/ url
3025. Find the Number of Ways to Place People I brute force/for url
1792. Maximum Average Pass Ratio heap/calculate future gain url
37. Sudoku Solver recursive serarch url
36. Valid Sudoku set() url
3021. Alice and Bob Playing Flower Game odd/even url
498. Diagonal Traverse control index in 2d field url
1493. Longest Subarray of 1's After Deleting One Element window search url
3195. Find the Minimum Area to Cover All Ones I max/min, row/height url
1504. Count Submatrices With All Ones url
1277. Count Square Submatrices with All Ones DP for the number of areas url
2348. Number of Zero-Filled Subarrays calculate the contiguous sequence of elements url
3000. Maximum Area of Longest Diagonal Rectangle calculate the area/diagonal url
679. 24 Game Brute force/Recursive search url
837. New 21 Game Dynamic Programming/Probability/window sum url
342. Power of Four devided by three url
2264. Largest 3-Same-Digit Number in String for/maximum string url
326. Power of Three devided by three url
2787. Ways to Express an Integer as Sum of Powers Dynamic Programming url
2438. Range Product Queries of Powers Prefix Product Preprocessing/modular inverses url
869. Reordered Power of 2 counter url
231. Power of Two n&(n-1)=0 url
1323. Maximum 69 Number string.replace("6","9",1) url
808. Soup Servings dp/probability url
898. Bitwise ORs of Subarrays Dynamic Programming, Monotonic increasing url
118. Pascal's Triangle for/if url
904. Fruit Into Baskets sliding window url
3477. Fruits Into Baskets II brute force search url
3479. Fruits Into Baskets III segment tree/Efficient range maximum,minimum query under 'left-to-right' constraint url
2419. Longest Subarray With Maximum Bitwise AND Greedy search url
2411. Smallest Subarrays With Maximum Bitwise OR Bit Manipulation / Greedy Algorithm / Reverse Iteration / Bit Tracking url
2044. Count Number of Maximum Bitwise-OR Subsets brute-force search with bit manipulation url
2210. Count Hills and Valleys in an Array for/if url
1717. Maximum Score From Removing Substrings greedy approach url
1695. Maximum Erasure Value sliding window approach url
1957. Delete Characters to Make Fancy String if/len url
1233. Remove Sub-Folders from the Filesystem sort/startwith() url
3202. Find the Maximum Length of Valid Subsequence II dp(mod k) url
3201. Find the Maximum Length of Valid Subsequence I brute force(odd+odd/even+even/odd+even/even+odd) url
3487. Maximum Unique Subarray Sum After Deletion sliding window/set url
3136. Valid Word set/if/for/isdigit()/isalpha() url
1290. Convert Binary Number in a Linked List to Integer list/bit length url
2410. Maximum Matching of Players With Trainers greedy/sort url
3440. Reschedule Meetings for Maximum Free Time II accumulated sum/window search url
3439. Reschedule Meetings for Maximum Free Time I accumulated sum/window search url
1353. Maximum Number of Events That Can Be Attended Heap/Greedy Algorithm url
1865. Finding Pairs With a Certain Sum freq/defaultdict url
3579. Minimum Steps to Convert String with Operations DynamicProgramming/Substring partitioning with recursive optimization of reverse, swap, and replace operations url
3597. Partition String set/string url
1394. Find Lucky Integer in an Array defaultdict url
3602. Hexadecimal and Hexatrigesimal Conversion base16 url
3333. Find the Original Typed String II Dynamic Programming/after-effects/cumulative sum url
3304. Find the K-th Character in String Game I while url
3330. Find the Original Typed String I array url
594. Longest Harmonious Subsequence array url
1498. Number of Subsequences That Satisfy the Given Sum Condition Double Pointer Sliding Window url
2014. Longest Subsequence Repeated k Times iterator/BFS url
2040. Kth Smallest Product of Two Sorted Arrays binary search/Divide and Conquer url
2081. Sum of k-Mirror Numbers palindrome/base-k/yeild url
2099. Find Subsequence of Length K With the Largest Sum brute force url
2311. Longest Binary Subsequence Less Than or Equal to K brute force url
2200. Find All K-Distant Indices in an Array for/if/array url
2138. Divide a String Into Groups of Size k brute force url
3085. Minimum Deletions to Make String K-Special brute force for all candidates url
3443. Maximum Manhattan Distance After K Changes step-by-step/count the maximum distance in each step by O(1) url
2294. Partition Array Such That Maximum Difference Is K sort/brute force url
2966. Divide Array Into Arrays With Max Difference sort/brute force url
2016. Maximum Difference Between Increasing Elements diff/brute force url
1432. Max Difference You Can Get From Changing an Integer replace integer/str.replace(s1,s2) url
2616. Minimize the Maximum Difference of Pairs binary search url
2566. Maximum Difference by Remapping a Digit replace url
3423. Maximum Difference Between Adjacent Elements in a Circular Array index of Adjacent Elements url
3442. Maximum Difference Between Even and Odd Frequency I odd/even url
386. Lexicographical Numbers increment Lexicographically url
1298. Maximum Candies You Can Get from Boxes BFS(Broaden firsts search) url
3170. Lexicographically Minimum String After Removing Stars stack push(),pop() url
2434. Using a Robot to Print the Lexicographically Smallest String stack/manage minimum charactor string url
1061. Lexicographically Smallest Equivalent String UnionFind url
3403. Find the Lexicographically Largest String From the Box I Lexicographically Large/Start from lerge char string url
135. Candy Greedy Algorithm/Bidirectional Scan/Local Optimization url
2929. Distribute Candies Among Children II inclusion-exclusion principle url
909. Snakes and Ladders BFS url
2359. Find Closest Node to Given Two Nodes BFS url
3373. Maximize the Number of Target Nodes After Connecting Trees II BFS/binary tree capability,structure url
3372. Maximize the Number of Target Nodes After Connecting Trees I BFS/Tree structure url
2894. Divisible and Non-divisible Sums Difference for/number sequence url
1857. Largest Color Value in a Directed Graph topological sort/dp url
3068. Find the Maximum Sum of Node Values pick up gain from sorted array url
3068. Find the Maximum Sum of Node Values fascinating key insight url
2131. Longest Palindrome by Concatenating Two Letter Words count reversed words/pair words url
2942. Find Words Containing Character if/array/enumerate url
3362. Zero Array Transformation III sort/heapq/differencial sum url
73. Set Matrix Zeroes in-place zero flag url
3355. Zero Array Transformation I Difference Array(imos) url
3024. Type of Triangle if/array/sort url
1931. Painting a Grid With Three Different Colors DP/check state transition url
3337. Total Characters in String After Transformations II Approach: Matrix Multiplication + Matrix Exponentiation By Squaring url
75. Sort Colors sort url
Longest Unequal Adjacent Groups Subsequence II dynamic programming url
2900. Longest Unequal Adjacent Groups Subsequence I count url
3335. Total Characters in String After Transformations I counter/26characters url
2094. Finding 3-Digit Even Numbers brute force url
1550. Three Consecutive Odds odd/even url
3343. Count Number of Balanced Permutations dynamic programming/combinations url
2918. Minimum Equal Sum of Two Arrays After Replacing Zeros case division url
3342. Find Minimum Time to Reach Last Room II heapq/djkstra algorithm url
3341. Find Minimum Time to Reach Last Room I Shortest Path + Dijkstra url
1920. Build Array from Permutation array/for url
790. Domino and Tromino Tiling Dynamic Programming url
2071. Maximum Number of Tasks You Can Assign binary search/sort url
1128. Number of Equivalent Domino Pairs defaultdict/combination url
1007. Minimum Domino Rotations For Equal Row Brute force url
838. Push Dominoes Brute force url
1295. Find Numbers with Even Number of Digits odd/even url
2962. Count Subarrays Where Max Element Appears at Least K Times sliding window url
2302. Count Subarrays With Score Less Than K sliding window url
3392. Count Subarrays of Length Three With a Condition sum url
2845. Count of Interesting Subarrays accumlated sum url
2799. Count Complete Subarrays in an Array sliding window url
1399. Count Largest Group defaultdict,str(),int(),max url
2145. Count the Hidden Sequences min/max/array url
2179. Count Good Triplets in an Array Binary Indexed Tree/Count left and right previously/index alignment url
1922. Count Good Numbers pattern/count url
1534. Count Good Triplets brute force approach url
2537. Count the Number of Good Subarrays sliding window/count pairs url
2176. Count Equal and Divisible Pairs in an Array brute force approach url
38. Count and Say Recursive/run-length encoding url
2563. Count the Number of Fair Pairs binary search url
781. Rabbits in Forest patten/divide/mod url
2843. Count Symmetric Integers str/loop/while url
3375. Minimum Operations to Make Array Values Equal to K set url
3396. Minimum Number of Operations to Make Elements in Array Distinct defaultdict url
416. Partition Equal Subset Sum dynamic programing/partial sum url
368. Largest Divisible Subset dynamic programing/back trace url
1863. Sum of All Subset XOR Totals Full bit search algorithm url
2140. Solving Questions With Brainpower dynamic programming/update value and inherit the maximum value url
2873. Maximum Value of an Ordered Triplet I same as II url
2874. Maximum Value of an Ordered Triplet II cumulative sum/Greedy + Prefix Suffix Array url
1123. Lowest Common Ancestor of Deepest Leaves depth first search/binary tree url
2780. Minimum Index of a Valid Split accumulate/count from both left and right url
763. Partition Labels min/max url
2033. Minimum Operations to Make a Uni-Value Grid median/accumrated sum url
3394. Check if Grid can be Cut into Sections sort/blute force url
3169. Count Days Without Meetings line sweep/imos/defaultdict url
2115. Find All Possible Recipes from Given Supplies Tree/BFS from edges url
2401. Longest Nice Subarray sliding window url
3191. Minimum Operations to Make Binary Array Elements Equal to One I bit反転 url
2685. Count the Number of Complete Components BFS/count the number of vertex,edge url
1976. Number of Ways to Arrive at Destination Djikstra/ShortestPathLength url
3108. Minimum Cost Walk in Weighted Graph BFS/UnionTree/And(add 1 to all bits is "-1") url
2206. Divide Array Into Equal Pairs count odd url
3356. Zero Array Transformation II binary search url
2594. Minimum Time to Repair Cars binary search url
2226. Maximum Candies Allocated to K Children binary search url
2529. Maximum Count of Positive Integer and Negative Integer neg/pos count url
1358. Number of Substrings Containing All Three Characters 動的計画法 url
2560. House Robber IV 二分探索/全探索 url
3306. Count of Substrings Containing Every Vowel and K Consonants II sliding window url
3208. Alternating Groups II deque url
2523. Closest Prime Numbers in Range Sieve of Eratosthenes url
2379. Minimum Recolors to Get K Consecutive Black Blocks sliding window url
1780. Check if Number is a Sum of Powers of Three raising a number to a power url
2579. Count Total Number of Colored Cells calculate area url
2965. Find Missing and Repeated Values list url
2161. Partition Array According to Given Pivot array url
2570. Merge Two 2D Arrays by Summing Values sort/defaultdict url
2460. Apply Operations to an Array 愚直/BruteForce url
873. Length of Longest Fibonacci Subsequence フィボナッチ風数列/全探索/DP url
1749. Maximum Absolute Sum of Any Subarray 累積和のMin/Max url
1524. Number of Sub-arrays With Odd Sum DP/i番目までの偶奇の数 url
2467. Most Profitable Path in a Tree BFS/DFS url
1028. Recover a Tree From Preorder Traversal 二分木/TreeNode()/深さ計算してTree再現 url
889. Construct Binary Tree from Preorder and Postorder Traversal pre/postorderで探索indexを操作してTree再現 url
1261. Find Elements in a Contaminated Binary Tree binary tree/pointer/dfs url
1980. Find Unique Binary String 10進数への変換/文字列操作 url
1415. The k-th Lexicographical String of All Happy Strings of Length n 再帰/昇順に条件に合致する文字列を全探索して接続する/k番目を出力する url
2375. Construct Smallest Number From DI String permutation url
1352. Product of the Last K Numbers 累積和/掛け算版/0の位置を管理して位置以内であれば解を計算する url
1910. Remove All Occurrences of a Substring string find url
2342. Max Sum of a Pair With Equal Sum of Digits heapify/defaultdict url
3066. Minimum Operations to Exceed Threshold Value II heapify url
1718. Construct the Lexicographically Largest Valid Sequence 再帰/先頭から順に数字を埋めていく/最後まで進んだらOK url
2698. Find the Punishment Number of an Integer 再帰/左から分割して数値がゼロになる分割を見つける url
1079. Letter Tile Possibilities Permutations url
3174. Clear Digits append/pop url
2364. Count Number of Bad Pairs 問題文の言い換え/動的計画法/全探索 url
2349. Design a Number Container System 常に最新の値を管理する/クエリ時に最新情報と照合して正しい値を返す url
3160. Find the Number of Distinct Colors Among the Balls 色の数を管理 url
1726. Tuple with Same Product defaultdict()で掛け算の結果を管理/組合わせ url
1790. Check if One String Swap Can Make Strings Equal 文字列を比較 url
1800. Maximum Ascending Subarray Sum sumsを管理して最大を保存 url
3152. Special Array II 二分探索 url
3105. Longest Strictly Increasing or Strictly Decreasing Subarray 連続する増加/減少を管理 url
827. Making A Large Island unionfind/探索候補を全探索/上下左右の島をunionfindで管理して島のサイズを合算する url
2493. Divide Nodes Into the Maximum Number of Groups 全探索/幅優先探索で2部グラフ作成/独立する各グラフに対して最大のGroupを管理(unionfind) url
3151. Special Array I parityチェック/最後の1bitチェック url
2658. Maximum Number of Fish in a Grid BFS/幅優先探索 url
684. Redundant Connection unionfind url
1462. Course Schedule IV グラフ/BFS/親子関係 url
802. Find Eventual Safe States グラフ/逆方向 url
2017. Grid Game greedy search url
1765. Map of Highest Peak Breadth First Search url
1267. Count Servers that Communicate set/二次元 url
2948. Make Lexicographically Smallest Array by Swapping Elements グループ化して並び替え url
2127. Maximum Employees to Be Invited to a Meeting グラフサイクル検出/BFS/最長ループ探索 - -
2661. First Completely Painted Row or Column 訪れた座標を管理する/ビンゴゲームの要領でカウント url
2116. Check if a Parentheses String Can Be Valid 括弧の出現を管理する/unlockとlockを分けて、後ほど後ろから探索する url
3042. Count Prefix and Suffix Pairs I 文字列のprefix/suffixを比較する/全探索 url
2185. Counting Words With a Given Prefix 先頭から比較 url
https://leetcode.com/problems/word-subsets/submissions/1514050596/ 言い換え:比較対象の文字列の出現数最大を管理して比較に使う url
1400. Construct K Palindrome Strings 文字の出現数をカウント/場合分け url
3223. Minimum Length of String After Operations 文字の出現数を管理 url
2657. Find the Prefix Common Array of Two Arrays 配列内の出現数を先頭からカウントする/DynamicProgramming url
2429. Minimize XOR bit数の計算/XOR演算による最小値を求める url
2683. Neighboring Bitwise XOR 愚直に先頭からシミュレーション、高々2通りしかない url
2425. Bitwise XOR of All Pairings XOR���交換法則が成り立つ)の計算順序を工夫、結局のところ奇数個登場する値のxorを求めればOK url -
407. Trapping Rain Water II BFS/周囲の壁を管理/最も高さの低い順に探索 url -
1368. Minimum Cost to Make at Least One Valid Path in a Grid BFS/4方向/最短コストを記憶 url -
1408. String Matching in an Array 全探索/BruteForce url
1769. Minimum Number of Operations to Move All Balls to Each Box 変化時の差分管理 url
2381. Shifting Letters II 一次元のいもす法 url
1930. Unique Length-3 Palindromic Subsequences 文字の位置を記憶する url
2270. Number of Ways to Split Array 差分管理 url
2559. Count Vowel Strings 累積和 url
983. Minimum Cost For Tickets dp url
1422. Maximum Score After Splitting a String 尺取り法 url
2466. Count Ways To Build Good Strings dp url
1014. DynamicProgramming url
2872. BFS/leef nodeから順番に探索、kの倍数で枝切り url
2940. defaultdict/二分探索 url
2471. binary tree/sort url
3203. Find Minimum Diameter After Merging Two Trees BFS/木の長さ url
515. Find Largest Value in Each Tree Row BFS url
494. Target Sum 全探索/DP url
- - - -

About

for practice

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors