zdyxry / LeetCode

yiran's leetcode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yiran's leetcode

Bit Manipulation

Easy

  • 0136 Single Number
  • 0190 Reverse Bits
  • 0191 Number Of 1 Bits
  • 0231 Power Of Two
  • 0342 Power Of Four
  • 0371 Sum Of Two Integers
  • 0389 Find The Difference
  • 0401 Binary Watch
  • 0405 Convert a Number to Hexadecimal
  • 0461 Hamming Distance
  • 0476 Number Complement
  • 0477 Total Hamming Distance
  • 0645 Set Mismatch
  • 0693 Binary Number with Alternating Bits
  • 0762 Prime Number of Set Bits in Binary Representation
  • 0868 Binary Gap
  • 1486 XOR Operation in an Array
  • 1720 Decode XORed Array

Medium

  • 0137 Single Number II
  • 0187 Repeated DNA Sequences
  • 0201 Bitwise AND of Numbers Range
  • 0260 Single Number III
  • 0318 Maximum Product of Word Lengths
  • 0338 Counting Bits
  • 0421 Maximum XOR of Two Numbers in an Array
  • 1310 XOR Queries of a Subarray
  • 1442 Count Triplets That Can Form Two Arrays of Equal XOR

Hard

  • 1611 Minimum One Bit Operations to Make Integers Zero

Array

Easy

  • 0001 Two Sum
  • 0026 Remove Duplicates from Sorted Array
  • 0027 Remove Element
  • 0035 Search Insert Position
  • 0053 Maximum Subarray
  • 0066 Plus One
  • 0088 Merge Sorted Array
  • 0118 Pascal's Triangle
  • 0119 Pascal's Triangle II
  • 0121 Best Time to Buy and Sell Stock
  • 0122 Best Time to Buy and Sell Stock II
  • 0167 Two Sum II - Input array is sorted
  • 0169 Majority Element
  • 0189 Rotate Array
  • 0217 Contains Duplicate
  • 0219 Contains Duplicate II
  • 0268 Missing Number
  • 0283 Move Zeroes
  • 0412 Fizz Buzz
  • 0414 Third Maximum Number
  • 0448 Find All Numbers Disappeared in an Array
  • 0485 Max Consecutive Ones
  • 0509 Fibonacci Number
  • 0532 K-diff Pairs in an Array
  • 0561 Array Partition I
  • 0566 Reshape the Matrix
  • 0581 Shortest Unsorted Continuous Subarray
  • 0605 Can Place Flowers
  • 0628 Maximum Product of Three Numbers
  • 0643 Maximum Average Subarray I
  • 0661 Image Smoother
  • 0665 Non-decreasing Array
  • 0674 Longest Continuous Increasing Subsequence
  • 0697 Degree of an Array
  • 0724 Find Pivot Index
  • 0746 Min Cost Climbing Stairs
  • 0766 Toeplitz Matrix
  • 0830 Positions of Large Groups
  • 0832 Flipping an Image
  • 0849 Maximize Distance to Closest Person
  • 0888 Fair Candy Swap
  • 0896 Monotonic Array
  • 0905 Sort Array By Parity
  • 0922 Sort Array By Parity II
  • 0941 Valid Mountain Array
  • 0977 Squares of a Sorted Array
  • 0985 Sum of Even Numbers After Queries
  • 0989 Add to Array-Form of Integer
  • 1018 Binary Prefix Divisible By 5
  • 1089 Duplicate Zeros
  • 1185 Day of the Week
  • 1200 Minimum Absolute Difference
  • 1217 Play with Chips
  • 1252 Cells with Odd Values in a Matrix
  • 1260 Shift 2D Grid
  • 1266 Minimum Time Visiting All Points
  • 1275 Find Winner on a Tic Tac Toe Game
  • 1287 Element Appearing More Than 25% In Sorted Array
  • 1304 Find N Unique Integers Sum up to Zero
  • 1313 Decompress Run-Length Encoded List
  • 1365 How Many Numbers Are Smaller Than the Current Number
  • 1380 Lucky Numbers in a Matrix
  • 1385 Find the Distance Value Between Two Arrays
  • 1389 Create Target Array in the Given Order
  • 1394 Find Lucky Integer in an Array
  • 1399 Count Largest Group
  • 1413 Minimum Value to Get Positive Step by Step Sum
  • 1431 Kids With the Greatest Number of Candies
  • 1450 Number of Students Doing Homework at a Given Time
  • 1460 Make Two Arrays Equal by Reversing Sub-arrays
  • 1464 Maximum Product of Two Elements in an Array
  • 1470 Shuffle the Array
  • 1475 Final Prices With a Special Discount in a Shop
  • 1480 Running Sum of 1d Array
  • 1491 Average Salary Excluding the Minimum and Maximum Salary
  • 1502 Can Make Arithmetic Progression From Sequence
  • 1508 Range Sum of Sorted Subarray Sums
  • 1512 Number of Good Pairs
  • 1534 Count Good Triplets
  • 1539 Kth Missing Positive Number
  • 1550 Three Consecutive Odds
  • 1560 Most Visited Sector in a Circular Track
  • 1566 Detect Pattern of Length M Repeated K or More Times
  • 1572 Matrix Diagonal Sum
  • 1582 Special Positions in a Binary Matrix
  • 1588 Sum of All Odd Length Subarrays
  • 1608 Special Array With X Elements Greater Than or Equal X
  • 1619 Mean of Array After Removing Some Elements
  • 1629 Slowest Key
  • 1640 Check Array Formation Through Concatenation
  • 1646 Get Maximum in Generated Array
  • 1652 Defuse the Bomb
  • 1656 Design an Ordered Stream
  • 1672 Richest Customer Wealth
  • 1700 Number of Students Unable to Eat Lunch
  • 1732 Find the Highest Altitude
  • 1742 Maximum Number of Balls in a Box
  • 1748 Sum of Unique Elements
  • 1752 Check if Array Is Sorted and Rotated
  • 1758 Minimum Changes To Make Alternating Binary String
  • 1779 Find Nearest Point That Has the Same X or Y Coordinate
  • 1827 Minimum Operations to Make the Array Increasing
  • 1848 Minimum Distance to the Target Element
  • 1854 Maximum Population Year
  • 1869 Longer Contiguous Segments of Ones than Zeros

Medium

  • 0011 Container With Most Water
  • 0015 3Sum
  • 0016 3Sum Closest
  • 0018 4Sum
  • 0031 Next Permutation
  • 0033 Search in Rotated Sorted Array
  • 0034 Find First and Last Position of Element in Sorted Array
  • 0039 Combination Sum
  • 0040 Combination Sum II
  • 0048 Rotate Image
  • 0054 Spiral Matrix
  • 0055 Jump Game
  • 0056 Merge Intervals
  • 0059 Spiral Matrix II
  • 0062 Unique Paths
  • 0063 Unique Paths II
  • 0064 Minimum Path Sum
  • 0073 Set Matrix Zeroes
  • 0074 Search a 2D Matrix
  • 0075 Sort Colors
  • 0078 Subsets
  • 0079 Word Search
  • 0080 Remove Duplicates from Sorted Array II
  • 0081 Search in Rotated Sorted Array II
  • 0090 Subsets II
  • 0105 Construct Binary Tree from Preorder and Inorder Traversal
  • 0106 Construct Binary Tree from Inorder and Postorder Traversal
  • 0120 Triangle
  • 0152 Maximum Product Subarray
  • 0153 Find Minimum in Rotated Sorted Array
  • 0209 Minimum Size Subarray Sum
  • 0216 Combination Sum III
  • 0228 Summary Ranges
  • 0229 Majority Element II
  • 0238 Product of Array Except Self
  • 0287 Find the Duplicate Number
  • 0442 Find All Duplicates in an Array
  • 0495 Teemo Attacking
  • 0498 Diagonal Traverse
  • 0565 Array Nesting
  • 0769 Max Chunks To Make Sorted
  • 0807 Max Increase to Keep City Skyline
  • 0926 Flip String to Monotone Increasing
  • 0950 Reveal Cards In Increasing Order
  • 1052 Grumpy Bookstore Owner
  • 1222 Queens That Can Attack the King
  • 1233 Remove Sub-Folders from the Filesystem
  • 1300 Sum of Mutated Array Closest to Target
  • 1329 Sort the Matrix Diagonally
  • 1337 The K Weakest Rows in a Matrix
  • 1338 Reduce Array Size to The Half
  • 1343 Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold
  • 1366 Rank Teams by Votes
  • 1375 Bulb Switcher III
  • 1395 Count Number of Teams
  • 1409 Queries on a Permutation With Key
  • 1423 Maximum Points You Can Obtain from Cards
  • 1424 Diagonal Traverse II
  • 1437 Check If All 1's Are at Least Length K Places Away
  • 1438 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
  • 1465 Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts
  • 1471 The k Strongest Values in an Array
  • 1476 Subrectangle Queries
  • 1488 Avoid Flood in The City
  • 1493 Longest Subarray of 1's After Deleting One Element
  • 1497 Check If Array Pairs Are Divisible by k
  • 1503 Last Moment Before All Ants Fall Out of a Plank
  • 1509 Minimum Difference Between Largest and Smallest Value in Three Moves
  • 1524 Number of Sub-arrays With Odd Sum
  • 1535 Find the Winner of an Array Game
  • 1583 Count Unhappy Friends
  • 1701 Average Waiting Time
  • 1769 Minimum Number of Operations to Move All Balls to Each Box

Hash Table

Easy

  • 0202 Happy Number
  • 0204 Count Primes
  • 0205 Isomorphic Strings
  • 0242 Valid Anagram
  • 0290 Word Pattern
  • 0387 First Unique Character in a String
  • 0409 Longest Palindrome
  • 0438 Find All Anagrams in a String
  • 0463 Island Perimeter
  • 0500 Keyboard Row
  • 0506 Relative Ranks
  • 0575 Distribute Candies
  • 0594 Longest Harmonious Subsequence
  • 0599 Minimum Index Sum of Two Lists
  • 0705 Design HashSet
  • 0706 Design HashMap
  • 0771 Jewels and Stones
  • 0811 Subdomain Visit Count
  • 0884 Uncommon Words from Two Sentences
  • 0953 Verifying an Alien Dictionary
  • 0961 N-Repeated Element in Size 2N Array
  • 1002 Find Common Characters
  • 1160 Find Words That Can Be Formed by Characters

Medium

  • 0003 Longest Substring Without Repeating Characters
  • 0036 Valid Sudoku
  • 0049 Group Anagrams
  • 0094 Binary Tree Inorder Traversal
  • 0138 Copy List with Random Pointer
  • 0347 Top K Frequent Elements
  • 0451 Sort Characters By Frequency
  • 0454 4Sum II
  • 0525 Contiguous Array
  • 0554 Brick Wall
  • 0560 Subarray Sum Equals K
  • 0648 Replace Words
  • 0692 Top K Frequent Words
  • 0718 Maximum Length of Repeated Subarray
  • 0739 Daily Temperatures
  • 0781 Rabbits in Forest
  • 0930 Binary Subarrays With Sum
  • 0939 Minimum Area Rectangle
  • 0954 Array of Doubled Pairs
  • 0974 Subarray Sums Divisible by K
  • 1090 Largest Values From Labels
  • 1418 Display Table of Food Orders in a Restaurant
  • 1487 Making File Names Unique
  • 1638 Count Substrings That Differ by One Character
  • 1679 Max Number of K-Sum Pairs

String

Easy

  • 0013 Roman to Integer
  • 0014 Longest Common Prefix
  • 0020 Valid Parentheses
  • 0067 Add Binary
  • 0344 Reverse String
  • 0383 Ransom Note
  • 0415 Add Strings
  • 0434 Number of Segments in a String
  • 0443 String Compression
  • 0459 Repeated Substring Pattern
  • 0482 License Key Formatting
  • 0520 Detect Capital
  • 0551 Student Attendance Record I
  • 0557 Reverse Words in a String III
  • 0657 Robot Return to Origin
  • 0680 Valid Palindrome II
  • 0696 Count Binary Substrings
  • 0709. To Lower Case
  • 0788 Rotated Digits
  • 0796 Rotate String
  • 0804 Unique Morse Code Words
  • 0821 Shortest Distance to a Character
  • 0859 Buddy Strings
  • 0917 Reverse Only Letters
  • 0925 Long Pressed Name
  • 0929 Unique Email Addresses
  • 0937 Reorder Data in Log Files
  • 1108 Defanging an IP Address
  • 1189 Maximum Number of Balloons
  • 1309 Decrypt String from Alphabet to Integer Mapping
  • 1370 Increasing Decreasing String
  • 1374 Generate a String With Characters That Have Odd Counts
  • 1408 String Matching in an Array
  • 1417 Reformat The String
  • 1422 Maximum Score After Splitting a String
  • 1436 Destination City
  • 1446 Consecutive Characters
  • 1455 Check If a Word Occurs As a Prefix of Any Word in a Sentence
  • 1496 Path Crossing
  • 1556 Thousand Separator
  • 1576 Replace All ?'s to Avoid Consecutive Repeating Characters
  • 1592 Rearrange Spaces Between Words
  • 1614 Maximum Nesting Depth of the Parentheses
  • 1624 Largest Substring Between Two Equal Characters
  • 1662 Check If Two String Arrays are Equivalent
  • 1668 Maximum Repeating Substring
  • 1678 Goal Parser Interpretation
  • 1684 Count the Number of Consistent Strings
  • 1694 Reformat Phone Number
  • 1704 Determine if String Halves Are Alike
  • 1736 Latest Time by Replacing Hidden Digits
  • 1763 Longest Nice Substring
  • 1768 Merge Strings Alternately
  • 1773 Count Items Matching a Rule
  • 1790 Check if One String Swap Can Make Strings Equal
  • 1796 Second Largest Digit in a String
  • 1805 Number of Different Integers in a String
  • 1816 Truncate Sentence
  • 1832 Check if the Sentence Is Pangram
  • 1844 Replace All Digits with Characters
  • 1876 Substrings of Size Three with Distinct Characters
  • 1897 Redistribute Characters to Make All Strings Equal

Medium

  • 0005 Longest Palindromic Substring
  • 0006 ZigZag Conversion
  • 0017 Letter Combinations of a Phone Number
  • 0022 Generate Parentheses
  • 0043 Multiply Strings
  • 0093 Restore IP Addresses
  • 0151 Reverse Words in a String
  • 0227 Basic Calculator II
  • 0539 Minimum Time Difference
  • 0583 Delete Operation for Two Strings
  • 0609 Find Duplicate File in System
  • 0647 Palindromic Substrings
  • 0678 Valid Parenthesis String
  • 0767 Reorganize String
  • 0791 Custom Sort String
  • 0816 Ambiguous Coordinates
  • 0842 Split Array into Fibonacci Sequence
  • 0848 Shifting Letters
  • 0856 Score of Parentheses
  • 0890 Find and Replace Pattern
  • 0916 Word Subsets
  • 1138 Alphabet Board Path
  • 1347 Minimum Number of Steps to Make Two Strings Anagram
  • 1358 Number of Substrings Containing All Three Characters
  • 1371 Find the Longest Substring Containing Vowels in Even Counts
  • 1404 Number of Steps to Reduce a Number in Binary Representation to One
  • 1410 HTML Entity Parser
  • 1419 Minimum Number of Frogs Croaking
  • 1432 Max Difference You Can Get From Changing an Integer
  • 1433 Check If a String Can Break Another String
  • 1451 Rearrange Words in a Sentence
  • 1456 Maximum Number of Vowels in a Substring of Given Length
  • 1461 Check If a String Contains All Binary Codes of Size K
  • 1525 Number of Good Ways to Split a String
  • 1529 Bulb Switcher IV
  • 1540 Can Convert String in K Moves
  • 1545 Find Kth Bit in Nth Binary String
  • 1663 Smallest String With A Given Numeric Value
  • 1839 Longest Substring Of All Vowels in Order

Linked List

Easy

  • 0021 Merge Two Sorted Lists
  • 0083 Remove Duplicates from Sorted List
  • 0141 Linked List Cycle
  • 0160 Intersection of Two Linked Lists
  • 0203 Remove Linked List Elements
  • 0206 Reverse Linked List
  • 0234 Palindrome Linked List
  • 0237 Delete Node in a Linked List
  • 0707 Design Linked List
  • 0876 Middle of the Linked List

Medium

  • 0002 Add Two Numbers
  • 0019 Remove Nth Node From End of List
  • 0024 Swap Nodes in Pairs
  • 0061 Rotate List
  • 0082 Remove Duplicates from Sorted List II
  • 0086 Partition List
  • 0092 Reverse Linked List II
  • 0109 Convert Sorted List to Binary Search Tree
  • 0142 Linked List Cycle II
  • 0143 Reorder List
  • 0147 Insertion Sort List
  • 0148 Sort List
  • 0328 Odd Even Linked List
  • 0445 Add Two Numbers II
  • 0817 Linked List Components
  • 1019 Next Greater Node In Linked List
  • 1171 Remove Zero Sum Consecutive Nodes from Linked List
  • 1367 Linked List in Binary Tree
  • 1669 Merge In Between Linked Lists
  • 1721 Swapping Nodes in a Linked List

Hard

  • 0023 Merge k Sorted Lists
  • 0025 Reverse Nodes in k-Group

Stack

Easy

  • 0155 Min Stack
  • 0225 Implement Stack using Queues
  • 0232 Implement Queue using Stacks
  • 0496 Next Greater Element I
  • 0682 Baseball Game
  • 0844 Backspace String Compare
  • 1021 Remove Outermost Parentheses
  • 1047 Remove All Adjacent Duplicates In String
  • 1441 Build an Array With Stack Operations
  • 1544 Make The String Great
  • 1598 Crawler Log Folder

Medium

  • 0071 Simplify Path
  • 0103 Binary Tree Zigzag Level Order Traversal
  • 0144 Binary Tree Preorder Traversal
  • 0150 Evaluate Reverse Polish Notation
  • 0331 Verify Preorder Serialization of a Binary Tree
  • 0394 Decode String
  • 0402 Remove K Digits
  • 0456 132 Pattern
  • 0503 Next Greater Element II
  • 0735 Asteroid Collision
  • 0880 Decoded String at Index
  • 0901 Online Stock Span
  • 0907 Sum of Subarray Minimums
  • 0921 Minimum Add to Make Parentheses Valid
  • 0946 Validate Stack Sequences
  • 1130 Minimum Cost Tree From Leaf Values
  • 1190 Reverse Substrings Between Each Pair of Parentheses
  • 1209 Remove All Adjacent Duplicates in String II
  • 1249 Minimum Remove to Make Valid Parentheses
  • 1541 Minimum Insertions to Balance a Parentheses String
  • 1642 Furthest Building You Can Reach
  • 1673 Find the Most Competitive Subsequence

Heap

Easy

  • 0703 Kth Largest Element in a Stream
  • 1046 Last Stone Weight

Medium

  • 0215 Kth Largest Element in an Array
  • 0264 Ugly Number II
  • 0313 Super Ugly Number
  • 0373 Find K Pairs with Smallest Sums
  • 0378 Kth Smallest Element in a Sorted Matrix
  • 0659 Split Array into Consecutive Subsequences

Tree

Easy

  • 0100 Same Tree
  • 0101 Symmetric Tree
  • 0104 Maximum Depth of Binary Tree
  • 0107 Binary Tree Level Order Traversal II
  • 0108 Convert Sorted Array to Binary Search Tree
  • 0110 Balanced Binary Tree
  • 0111 Minimum Depth of Binary Tree
  • 0112 Path Sum
  • 0226 Invert Binary Tree
  • 0235 Lowest Common Ancestor of a Binary Search Tree
  • 0257 Binary Tree Paths
  • 0404 Sum of Left Leaves
  • 0429 N-ary Tree Level Order Traversal
  • 0437 Path Sum III
  • 0501 Find Mode in Binary Search Tree
  • 0530 Minimum Absolute Difference in BST
  • 0538 Convert BST to Greater Tree
  • 0543 Diameter of Binary Tree
  • 0559 Maximum Depth of N-ary Tree
  • 0563 Binary Tree Tilt
  • 0572 Subtree of Another Tree
  • 0589 N-ary Tree Preorder Traversal
  • 0590 N-ary Tree Postorder Traversal
  • 0617 Merge Two Binary Trees
  • 0637 Average of Levels in Binary Tree
  • 0653 Two Sum IV - Input is a BST
  • 0669 Trim a Binary Search Tree
  • 0687 Longest Univalue Path
  • 0700 Search in a Binary Search Tree
  • 0783 Minimum Distance Between BST Nodes
  • 0872 Leaf-Similar Trees
  • 0938 Range Sum of BST
  • 0965 Univalued Binary Tree
  • 0993 Cousins in Binary Tree
  • 1022 Sum of Root To Leaf Binary Numbers

Medium

  • 0095 Unique Binary Search Trees II
  • 0096 Unique Binary Search Trees
  • 0098 Validate Binary Search Tree
  • 0102 Binary Tree Level Order Traversal
  • 0113 Path Sum II
  • 0114 Flatten Binary Tree to Linked List
  • 0116 Populating Next Right Pointers in Each Node
  • 0117 Populating Next Right Pointers in Each Node II
  • 0129 Sum Root to Leaf Numbers
  • 0145 Binary Tree Postorder Traversal
  • 0173 Binary Search Tree Iterator
  • 0199 Binary Tree Right Side View
  • 0230 Kth Smallest Element in a BST
  • 0236 Lowest Common Ancestor of a Binary Tree
  • 0654 Maximum Binary Tree
  • 0701 Insert into a Binary Search Tree
  • 0814 Binary Tree Pruning
  • 0894 All Possible Full Binary Trees
  • 1008 Construct Binary Search Tree from Preorder Traversal
  • 1026 Maximum Difference Between Node and Ancestor
  • 1104 Path In Zigzag Labelled Binary Tree
  • 1038 Binary Search Tree to Greater Sum Tree
  • 1302 Deepest Leaves Sum
  • 1305 All Elements in Two Binary Search Trees
  • 1325 Delete Leaves With a Given Value
  • 1372 Longest ZigZag Path in a Binary Tree
  • 1379 Find a Corresponding Node of a Binary Tree in a Clone of That Tree
  • 1382 Balance a Binary Search Tree
  • 1600 Throne Inheritance
  • 1609 Even Odd Tree

Binary Search

Easy

  • 0069 Sqrt(x)
  • 0278 First Bad Version
  • 0367 Valid Perfect Square
  • 0392 Is Subsequence
  • 0704 Binary Search
  • 0852 Peak Index in a Mountain Array

Medium

  • 0240 Search a 2D Matrix II
  • 0875 Koko Eating Bananas
  • 0981 Time Based Key-Value Store
  • 1111 Maximum Nesting Depth of Two Valid Parentheses Strings
  • 1482 Minimum Number of Days to Make m Bouquets
  • 1552 Magnetic Force Between Two Balls

Hard

  • 0410 Split Array Largest Sum

Sort

Easy

  • 0349 Intersection of Two Arrays
  • 0350 Intersection of Two Arrays II
  • 0976 Largest Perimeter Triangle
  • 1030 Matrix Cells in Distance Order
  • 1122 Relative Sort Array
  • 1528 Shuffle String
  • 1636 Sort Array by Increasing Frequency
  • 1710 Maximum Units on a Truck

Medium

  • 0179 Largest Number
  • 1387 Sort Integers by The Power Value
  • 1452 People Whose List of Favorite Companies Is Not a Subset of Another List
  • 1481 Least Number of Unique Integers after K Removals
  • 1498 Number of Subsequences That Satisfy the Given Sum Condition
  • 1561 Maximum Number of Coins You Can Get
  • 1630 Arithmetic Subarrays
  • 1637 Widest Vertical Area Between Two Points Containing No Points

Math

Easy

  • 0168 Excel Sheet Column Title
  • 0171 Excel Sheet Column Number
  • 0172 Factorial Trailing Zeroes
  • 0263 Ugly Number
  • 0441 Arranging Coins
  • 0453 Minimum Moves to Equal Array Elements
  • 0492 Construct the Rectangle
  • 0504 Base 7
  • 0728 Self Dividing Numbers
  • 0883 Projection Area of 3D Shapes
  • 0908 Smallest Range I
  • 0942 DI String Match
  • 1009 Complement of Base 10 Integer
  • 1025 Divisor Game
  • 1154 Day of the Year
  • 1232 Check If It Is a Straight Line
  • 1317 Convert Integer to the Sum of Two No-Zero Integers
  • 1523 Count Odd Numbers in an Interval Range
  • 1716 Calculate Money in Leetcode Bank
  • 1822 Sign of the Product of an Array
  • 1837 Sum of Digits in Base K

Medium

  • 0029 Divide Two Integers
  • 0050 Pow(x, n)
  • 0343 Integer Break
  • 0462 Minimum Moves to Equal Array Elements II
  • 0553 Optimal Division
  • 0754 Reach a Number
  • 1227 Airplane Seat Assignment Probability
  • 1344 Angle Between Hands of a Clock
  • 1362 Closest Divisors
  • 1363 Largest Multiple of Three
  • 1390 Four Divisors
  • 1401 Circle and Rectangle Overlapping
  • 1447 Simplified Fractions
  • 1492 The kth Factor of n
  • 1513 Number of Substrings With Only 1s
  • 1551 Minimum Operations to Make Array Equal
  • 1685 Sum of Absolute Differences in a Sorted Array

Backtracking

Easy

  • 1688 Count of Matches in Tournament

Medium

  • 0089 Gray Code
  • 0046 Permutations
  • 0047 Permutations II
  • 0060 Permutation Sequence
  • 0077 Combinations
  • 0131 Palindrome Partitioning
  • 0784 Letter Case Permutation
  • 1079. Letter Tile Possibilities
  • 1219 Path with Maximum Gold
  • 1286 Iterator for Combination
  • 1415 The k-th Lexicographical String of All Happy Strings of Length n
  • 1593 Split a String Into the Max Number of Unique Substrings

Dynamic Programming

Easy

  • 0198 House Robber
  • 0221 Maximal Square

Medium

  • 0072 Edit Distance
  • 0091 Decode Ways
  • 0139 Word Break
  • 0279 Perfect Squares
  • 0309 Best Time to Buy and Sell Stock with Cooldown
  • 0322 Coin Change
  • 0375 Guess Number Higher or Lower II
  • 0494 Target Sum
  • 1048 Longest String Chain
  • 1155 Number of Dice Rolls With Target Sum
  • 1262 Greatest Sum Divisible by Three
  • 1277 Count Square Submatrices with All Ones
  • 1314 Matrix Block Sum
  • 1546 Maximum Number of Non-Overlapping Subarrays With Sum Equals Target
  • 1641 Count Sorted Vowel Strings
  • 1664 Ways to Make a Fair Array

Depth-First Search

Easy

  • 0897 Increasing Order Search Tree

Medium

  • 0200 Number of Islands
  • 0695 Max Area of Island
  • 0797 All Paths From Source to Target
  • 1110 Delete Nodes And Return Forest
  • 1123 Lowest Common Ancestor of Deepest Leaves
  • 1145 Binary Tree Coloring Game
  • 1315 Sum of Nodes with Even-Valued Grandparent
  • 1376 Time Needed to Inform All Employees
  • 1443 Minimum Time to Collect All Apples in a Tree
  • 1448 Count Good Nodes in Binary Tree
  • 1457 Pseudo-Palindromic Paths in a Binary Tree
  • 1519 Number of Nodes in the Sub-Tree With the Same Label
  • 1530 Number of Good Leaf Nodes Pairs
  • 1625 Lexicographically Smallest String After Applying Operations

Breadth-First Search

Medium

  • 0127 Word Ladder
  • 1466 Reorder Routes to Make All Paths Lead to the City Zero

Design

Easy

  • 1603 Design Parking System

Medium

  • 1348 Tweet Counts Per Frequency
  • 1352 Product of the Last K Numbers
  • 1357 Apply Discount Every n Orders
  • 1381 Design a Stack With Increment Operation
  • 1396 Design Underground System
  • 1472 Design Browser History
  • 1670 Design Front Middle Back Queue

Greedy

Easy

  • 0455 Assign Cookies
  • 0860 Lemonade Change
  • 1221 Split a String in Balanced Strings
  • 1403 Minimum Subsequence in Non-Increasing Order
  • 1518 Water Bottles
  • 1725 Number Of Rectangles That Can Form The Largest Square
  • 1784 Check if Binary String Has at Most One Segment of Ones

Medium

  • 0406 Queue Reconstruction by Height
  • 0763 Partition Labels
  • 0861 Score After Flipping Matrix
  • 1094 Car Pooling
  • 1282 Group the People Given the Group Size They Belong To
  • 1353 Maximum Number of Events That Can Be Attended
  • 1354 Construct Target Array With Multiple Sums
  • 1386 Cinema Seat Allocation
  • 1400 Construct K Palindrome Strings
  • 1405 Longest Happy String
  • 1414 Find the Minimum Number of Fibonacci Numbers Whose Sum Is K
  • 1536 Minimum Swaps to Arrange a Binary Grid
  • 1558 Minimum Numbers of Function Calls to Make Target Array
  • 1567 Maximum Length of Subarray With Positive Product
  • 1578 Minimum Deletion Cost to Avoid Repeating Letters
  • 1605 Find Valid Matrix Given Row and Column Sums
  • 1647 Minimum Deletions to Make Character Frequencies Unique
  • 1653 Minimum Deletions to Make String Balanced
  • 1657 Determine if Two Strings Are Close
  • 1663 Smallest String With A Given Numeric Value
  • 1689 Partitioning Into Minimum Number Of Deci-Binary Numbers
  • 1702 Maximum Binary String After Change
  • 1743 Restore the Array From Adjacent Pairs
  • 1749 Maximum Absolute Sum of Any Subarray
  • 1753 Maximum Score From Removing Stones
  • 1764 Form Array by Concatenating Subarrays of Another Array
  • 1774 Closest Dessert Cost

Trie

Medium

  • 0677 Map Sum Pairs

Recursion

Easy

  • 1137 N-th Tribonacci Number

Medium

  • 0779 K-th Symbol in Grammar

Concurrency

Easy

  • 1114 Print in Order

Graph

Medium

  • 1161 Maximum Level Sum of a Binary Tree
  • 1557 Minimum Number of Vertices to Reach All Nodes

Line Sweep

Medium

  • 1288 Remove Covered Intervals

Two Pointers

Easy

  • 1800 Maximum Ascending Subarray Sum

Medium

  • 1695 Maximum Erasure Value

About

yiran's leetcode


Languages

Language:Python 51.2%Language:Go 48.8%