Python LeetCode Typing Practice
1807 LeetCode solutions in Python. Pick one to type it and see your WPM and accuracy.
- 01 Matrix · 28 lines
- 132 Pattern · 11 lines
- 1-bit and 2-bit Characters · 33 lines
- 24 Game · 36 lines
- 2 Keys Keyboard · 36 lines
- 3Sum · 25 lines
- 3Sum Closest · 19 lines
- 3Sum With Multiplicity · 15 lines
- 4Sum · 32 lines
- 4Sum II · 17 lines
- Abbreviating the Product of a Range · 42 lines
- Accounts Merge · 34 lines
- Add Binary · 9 lines
- Add Digits · 5 lines
- Adding Spaces to a String · 11 lines
- Adding Two Negabinary Numbers · 51 lines
- Additive Number · 20 lines
- Add Minimum Number of Rungs · 9 lines
- Add One Row to Tree · 13 lines
- Add Strings · 23 lines
- Add to Array-Form of Integer · 3 lines
- Add Two Integers · 3 lines
- Add Two Numbers · 24 lines
- Add Two Numbers II · 16 lines
- Advantage Shuffle · 29 lines
- Airplane Seat Assignment Probability · 4 lines
- Alert Using Same Key-Card Three or More Times in a One Hour Period · 24 lines
- All Ancestors of a Node in a Directed Acyclic Graph · 18 lines
- All Divisions With the Highest Score of a Binary Array · 28 lines
- All Elements in Two Binary Search Trees · 21 lines
- All Nodes Distance K in Binary Tree · 40 lines
- Allocate Mailboxes · 16 lines
- All O`one Data Structure · 257 lines
- All Paths From Source to Target · 14 lines
- All Possible Full Binary Trees · 53 lines
- Alphabet Board Path · 37 lines
- Ambiguous Coordinates · 36 lines
- Angle Between Hands of a Clock · 5 lines
- A Number After a Double Reversal · 4 lines
- Append K Integers With Minimal Sum · 16 lines
- Apply Discount Every n Orders · 31 lines
- Apply Discount to Prices · 13 lines
- Arithmetic Slices · 14 lines
- Arithmetic Slices II - Subsequence · 11 lines
- Arithmetic Subarrays · 21 lines
- Arranging Coins · 11 lines
- Array Nesting · 18 lines
- Array of Doubled Pairs · 31 lines
- Array Partition · 13 lines
- Array With Elements Not Equal to Average of Neighbors · 16 lines
- As Far from Land as Possible · 24 lines
- Assign Cookies · 16 lines
- Asteroid Collision · 18 lines
- Available Captures for Rook · 51 lines
- Average of Levels in Binary Tree · 32 lines
- Average Salary Excluding the Minimum and Maximum Salary · 4 lines
- Average Waiting Time · 14 lines
- Avoid Flood in The City · 32 lines
- Backspace String Compare · 18 lines
- Bag of Tokens · 22 lines
- Balance a Binary Search Tree · 32 lines
- Balanced Binary Tree · 35 lines
- Base 7 · 15 lines
- Baseball Game · 14 lines
- Basic Calculator · 34 lines
- Basic Calculator II · 29 lines
- Basic Calculator IV · 58 lines
- Battleships in a Board · 27 lines
- Beautiful Arrangement · 16 lines
- Beautiful Arrangement II · 12 lines
- Beautiful Array · 23 lines
- Best Poker Hand · 25 lines
- Best Position for a Service Centre · 35 lines
- Best Sightseeing Pair · 32 lines
- Best Team With No Conflicts · 21 lines
- Best Time to Buy and Sell Stock · 16 lines
- Best Time to Buy and Sell Stock II · 15 lines
- Best Time to Buy and Sell Stock III · 10 lines
- Best Time to Buy and Sell Stock IV · 9 lines
- Best Time to Buy and Sell Stock with Cooldown · 42 lines
- Best Time to Buy and Sell Stock with Transaction Fee · 26 lines
- Binary Gap · 9 lines
- Binary Number with Alternating Bits · 11 lines
- Binary Prefix Divisible By 5 · 8 lines
- Binary Search · 18 lines
- Binary Search Tree Iterator · 35 lines
- Binary Search Tree to Greater Sum Tree · 16 lines
- Binary String With Substrings Representing 1 To N · 9 lines
- Binary Subarrays With Sum · 15 lines
- Binary Tree Cameras · 62 lines
- Binary Tree Coloring Game · 41 lines
- Binary Tree Inorder Traversal · 40 lines
- Binary Tree Level Order Traversal · 29 lines
- Binary Tree Level Order Traversal II · 14 lines
- Binary Tree Maximum Path Sum · 23 lines
- Binary Tree Paths · 21 lines
- Binary Tree Postorder Traversal · 42 lines
- Binary Tree Preorder Traversal · 45 lines
- Binary Tree Pruning · 10 lines
- Binary Tree Right Side View · 27 lines
- Binary Trees With Factors · 15 lines
- Binary Tree Tilt · 24 lines
- Binary Tree Zigzag Level Order Traversal · 33 lines
- Binary Watch · 16 lines
- Bitwise AND of Numbers Range · 10 lines
- Bitwise ORs of Subarrays · 33 lines
- Boats to Save People · 14 lines
- Booking Concert Tickets in Groups · 121 lines
- Brace Expansion II · 26 lines
- Break a Palindrome · 17 lines
- Bricks Falling When Hit · 58 lines
- Brick Wall · 14 lines
- Broken Calculator · 15 lines
- Buddy Strings · 32 lines
- Build an Array With Stack Operations · 14 lines
- Build Array from Permutation · 13 lines
- Build Array Where You Can Find The Maximum Exactly K Comparisons · 11 lines
- Building Boxes · 13 lines
- Bulb Switcher · 3 lines
- Bulb Switcher II · 19 lines
- Bulls and Cows · 33 lines
- Burst Balloons · 12 lines
- Bus Routes · 46 lines
- Calculate Amount Paid in Taxes · 22 lines
- Calculate Digit Sum of a String · 11 lines
- Calculate Money in Leetcode Bank · 15 lines
- Camelcase Matching · 37 lines
- Can Convert String in K Moves · 18 lines
- Candy · 18 lines
- Can I Win · 22 lines
- Can Make Arithmetic Progression From Sequence · 8 lines
- Can Make Palindrome from Substring · 25 lines
- Can Place Flowers · 21 lines
- Can You Eat Your Favorite Candy on Your Favorite Day? · 8 lines
- Capacity To Ship Packages Within D Days · 22 lines
- Capitalize the Title · 9 lines
- Card Flipping Game · 11 lines
- Car Fleet · 21 lines
- Car Fleet II · 41 lines
- Car Pooling · 21 lines
- Cat and Mouse · 56 lines
- Cat and Mouse II · 105 lines
- Cells in a Range on an Excel Sheet · 16 lines
- Cells with Odd Values in a Matrix · 14 lines
- Chalkboard XOR Game · 6 lines
- Champagne Tower · 18 lines
- Change Minimum Characters to Satisfy One of Three Conditions · 15 lines
- Cheapest Flights Within K Stops · 21 lines
- Check Array Formation Through Concatenation · 9 lines
- Check Completeness of a Binary Tree · 18 lines
- Check If All 1's Are at Least Length K Places Away · 10 lines
- Check if All A's Appears Before All B's · 6 lines
- Check if All Characters Have Equal Number of Occurrences · 3 lines
- Check if All the Integers in a Range Are Covered · 14 lines
- Check if an Original String Exists Given Two Encoded Strings · 75 lines
- Check if a Parentheses String Can Be Valid · 19 lines
- Check if Array Is Sorted and Rotated · 9 lines
- Check If Array Pairs Are Divisible by k · 32 lines
- Check If a String Can Break Another String · 6 lines
- Check If a String Contains All Binary Codes of Size K · 12 lines
- Check If a Word Occurs As a Prefix of Any Word in a Sentence · 14 lines
- Check if Binary String Has at Most One Segment of Ones · 4 lines
- Check if Every Row and Column Contains All Numbers · 9 lines
- Check If It Is a Good Array · 9 lines
- Check If It Is a Straight Line · 19 lines
- Check if Matrix Is X-Matrix · 11 lines
- Check if Move is Legal · 28 lines
- Check If N and Its Double Exist · 25 lines
- Check if Number Has Equal Digit Count and Digit Value · 10 lines
- Check if Number is a Sum of Powers of Three · 7 lines
- Check if Numbers Are Ascending in a Sentence · 5 lines
- Check if One String Swap Can Make Strings Equal · 7 lines
- Check If String Is a Prefix of Array · 15 lines
- Check If String Is Transformable With Substring Sort Operations · 21 lines
- Check if There Is a Valid Parentheses String Path · 22 lines
- Check if There is a Valid Partition For The Array · 23 lines
- Check if There is a Valid Path in a Grid · 25 lines
- Check if the Sentence Is Pangram · 3 lines
- Check If Two String Arrays are Equivalent · 3 lines
- Check if Word Can Be Placed In Crossword · 60 lines
- Check if Word Equals Summation of Two Words · 47 lines
- Check If Word Is Valid After Substitutions · 16 lines
- Check Whether Two Strings are Almost Equivalent · 11 lines
- Cherry Pickup · 21 lines
- Cherry Pickup II · 27 lines
- Cinema Seat Allocation · 21 lines
- Circle and Rectangle Overlapping · 21 lines
- Circular Array Loop · 17 lines
- Circular Permutation in Binary Representation · 5 lines
- Climbing Stairs · 20 lines
- Clone Graph · 38 lines
- Closest Dessert Cost · 28 lines
- Closest Divisors · 8 lines
- Closest Room · 48 lines
- Closest Subsequence Sum · 57 lines
- Clumsy Factorial · 14 lines
- Coin Change · 25 lines
- Coin Change 2 · 15 lines
- Coloring A Border · 48 lines
- Combinations · 3 lines
- Combination Sum · 21 lines
- Combination Sum II · 17 lines
- Combination Sum III · 26 lines
- Combination Sum IV · 10 lines
- Compare Strings by Frequency of the Smallest Character · 27 lines
- Compare Version Numbers · 10 lines
- Complement of Base 10 Integer · 14 lines
- Complete Binary Tree Inserter · 57 lines
- Complex Number Multiplication · 11 lines
- Concatenated Words · 15 lines
- Concatenation of Array · 4 lines
- Concatenation of Consecutive Binary Numbers · 12 lines
- Consecutive Characters · 20 lines
- Consecutive Numbers Sum · 11 lines
- Constrained Subsequence Sum · 25 lines
- Construct Binary Search Tree from Preorder Traversal · 18 lines
- Construct Binary Tree from Inorder and Postorder Traversal · 63 lines
- Construct Binary Tree from Preorder and Inorder Traversal · 24 lines
- Construct Binary Tree from Preorder and Postorder Traversal · 36 lines
- Construct K Palindrome Strings · 15 lines
- Construct Quad Tree · 50 lines
- Construct String from Binary Tree · 21 lines
- Construct String With Repeat Limit · 46 lines
- Construct Target Array With Multiple Sums · 21 lines
- Construct the Lexicographically Largest Valid Sequence · 39 lines
- Construct the Rectangle · 20 lines
- Container With Most Water · 13 lines
- Contains Duplicate · 6 lines
- Contains Duplicate II · 9 lines
- Contains Duplicate III · 16 lines
- Contain Virus · 77 lines
- Contiguous Array · 17 lines
- Continuous Subarray Sum · 13 lines
- Convert 1D Array Into 2D Array · 7 lines
- Convert a Number to Hexadecimal · 33 lines
- Convert Binary Number in a Linked List to Integer · 19 lines
- Convert BST to Greater Tree · 28 lines
- Convert Integer to the Sum of Two No-Zero Integers · 7 lines
- Convert Sorted Array to Binary Search Tree · 13 lines
- Convert Sorted List to Binary Search Tree · 14 lines
- Convert to Base -2 · 11 lines
- Coordinate With Maximum Network Quality · 17 lines
- Copy List with Random Pointer · 87 lines
- Corporate Flight Bookings · 11 lines
- Count All Possible Routes · 34 lines
- Count All Valid Pickup and Delivery Options · 8 lines
- Count and Say · 19 lines
- Count Array Pairs Divisible by K · 22 lines
- Count Asterisks · 10 lines
- Count Binary Substrings · 34 lines
- Count Collisions on a Road · 3 lines
- Count Common Words With One Occurrence · 10 lines
- Count Complete Tree Nodes · 17 lines
- Count Different Palindromic Subsequences · 33 lines
- Count Elements With Strictly Smaller and Greater Elements · 5 lines
- Count Equal and Divisible Pairs in an Array · 9 lines
- Count Fertile Pyramids in a Land · 21 lines
- Count Good Meals · 22 lines
- Count Good Nodes in Binary Tree · 21 lines
- Count Good Numbers · 9 lines
- Count Good Triplets · 14 lines
- Count Good Triplets in an Array · 30 lines
- Count Hills and Valleys in an Array · 14 lines
- Counting Bits · 26 lines
- Counting Words With a Given Prefix · 3 lines
- Count Integers in Intervals · 32 lines
- Count Integers With Even Digit Sum · 13 lines
- Count Items Matching a Rule · 4 lines
- Count Largest Group · 42 lines
- Count Lattice Points Inside a Circle · 9 lines
- Count Negative Numbers in a Sorted Matrix · 17 lines
- Count Nice Pairs in an Array · 13 lines
- Count Nodes Equal to Average of Subtree · 23 lines
- Count Nodes With the Highest Score · 22 lines
- Count Number of Bad Pairs · 14 lines
- Count Number of Homogenous Substrings · 16 lines
- Count Number of Maximum Bitwise-OR Subsets · 14 lines
- Count Number of Nice Subarrays · 33 lines
- Count Number of Pairs With Absolute Difference K · 14 lines
- Count Number of Rectangles Containing Each Point · 43 lines
- Count Number of Special Subsequences · 18 lines
- Count Number of Teams · 16 lines
- Count Number of Texts · 23 lines
- Count Number of Ways to Place Houses · 25 lines
- Count Numbers with Unique Digits · 15 lines
- Count Odd Numbers in an Interval Range · 16 lines
- Count of Matches in Tournament · 3 lines
- Count of Range Sum · 11 lines
- Count of Smaller Numbers After Self · 42 lines
- Count Operations to Obtain Zero · 10 lines
- Count Pairs Of Nodes · 66 lines
- Count Pairs With XOR in a Range · 17 lines
- Count Prefixes of a Given String · 6 lines
- Count Primes · 27 lines
- Count Servers that Communicate · 23 lines
- Count Sorted Vowel Strings · 12 lines
- Count Special Quadruplets · 6 lines
- Count Square Submatrices with All Ones · 26 lines
- Count Square Sum Triples · 10 lines
- Count Subarrays With Score Less Than K · 10 lines
- Count Sub Islands · 28 lines
- Count Submatrices With All Ones · 25 lines
- Count Substrings That Differ by One Character · 11 lines
- Count Subtrees With Max Distance Between Cities · 67 lines
- Count the Hidden Sequences · 6 lines
- Count the Number of Consistent Strings · 13 lines
- Count the Number of Ideal Arrays · 57 lines
- Count The Repetitions · 19 lines
- Count Triplets That Can Form Two Arrays of Equal XOR · 21 lines
- Count Unguarded Cells in the Grid · 25 lines
- Count Unhappy Friends · 19 lines
- Count Unique Characters of All Substrings of a Given String · 55 lines
- Count Unreachable Pairs of Nodes in an Undirected Graph · 64 lines
- Count Vowels Permutation · 19 lines
- Count Vowel Substrings of a String · 34 lines
- Count Ways to Build Rooms in an Ant Colony · 36 lines
- Count Ways to Make Array With Product · 22 lines
- Count Words Obtained After Adding a Letter · 79 lines
- Couples Holding Hands · 15 lines
- Course Schedule · 29 lines
- Course Schedule II · 29 lines
- Course Schedule III · 21 lines
- Course Schedule IV · 28 lines
- Cousins in Binary Tree · 25 lines
- Cracking the Safe · 26 lines
- Crawler Log Folder · 20 lines
- Create Binary Tree From Descriptions · 21 lines
- Create Maximum Number · 75 lines
- Create Sorted Array through Instructions · 32 lines
- Create Target Array in the Given Order · 43 lines
- Critical Connections in a Network · 42 lines
- Custom Sort String · 26 lines
- Cut Off Trees for Golf Event · 42 lines
- Cyclically Rotating a Grid · 37 lines
- Daily Temperatures · 9 lines
- Data Stream as Disjoint Intervals · 26 lines
- Day of the Week · 52 lines
- Day of the Year · 29 lines
- Decoded String at Index · 20 lines
- Decode String · 21 lines
- Decode the Message · 16 lines
- Decode the Slanted Ciphertext · 12 lines
- Decode Ways · 43 lines
- Decode Ways II · 32 lines
- Decode XORed Array · 3 lines
- Decode XORed Permutation · 16 lines
- Decompress Run-Length Encoded List · 9 lines
- Decrease Elements To Make Array Zigzag · 25 lines
- Decrypt String from Alphabet to Integer Mapping · 5 lines
- Deepest Leaves Sum · 46 lines
- Defanging an IP Address · 3 lines
- Degree of an Array · 19 lines
- Delete and Earn · 23 lines
- Delete Characters to Make Fancy String · 11 lines
- Delete Columns to Make Sorted · 17 lines
- Delete Columns to Make Sorted II · 50 lines
- Delete Columns to Make Sorted III · 14 lines
- Delete Duplicate Folders in System · 38 lines
- Delete Leaves With a Given Value · 11 lines
- Delete Node in a BST · 64 lines
- Delete Node in a Linked List · 11 lines
- Delete Nodes And Return Forest · 44 lines
- Delete Operation for Two Strings · 18 lines
- Delete the Middle Node of a Linked List · 22 lines
- Delivering Boxes from Storage to Ports · 28 lines
- Describe the Painting · 12 lines
- Design Add and Search Words Data Structure · 48 lines
- Design a Food Rating System · 39 lines
- Design an ATM Machine · 20 lines
- Design an Ordered Stream · 23 lines
- Design a Number Container System · 29 lines
- Design a Stack With Increment Operation · 24 lines
- Design a Text Editor · 27 lines
- Design Authentication Manager · 28 lines
- Design Bitset · 34 lines
- Design Browser History · 38 lines
- Design Circular Deque · 53 lines
- Design Circular Queue · 34 lines
- Design Front Middle Back Queue · 44 lines
- Design HashMap · 13 lines
- Design HashSet · 16 lines
- Design Linked List · 97 lines
- Design Movie Rental System · 33 lines
- Design Parking System · 21 lines
- Design Skiplist · 21 lines
- Design Twitter · 26 lines
- Design Underground System · 23 lines
- Destination City · 13 lines
- Destroying Asteroids · 10 lines
- Detect Capital · 19 lines
- Detect Cycles in 2D Grid · 44 lines
- Detect Pattern of Length M Repeated K or More Times · 17 lines
- Detect Squares · 60 lines
- Determine Color of a Chessboard Square · 4 lines
- Determine if String Halves Are Alike · 12 lines
- Determine if Two Strings Are Close · 10 lines
- Determine Whether Matrix Can Be Obtained By Rotation · 19 lines
- Detonate the Maximum Bombs · 27 lines
- Diagonal Traverse · 20 lines
- Diagonal Traverse II · 16 lines
- Diameter of Binary Tree · 49 lines
- Dice Roll Simulation · 21 lines
- Different Ways to Add Parentheses · 22 lines
- Dinner Plate Stacks · 56 lines
- Display Table of Food Orders in a Restaurant · 35 lines
- Distance Between Bus Stops · 12 lines
- Distant Barcodes · 29 lines
- Distinct Echo Substrings · 14 lines
- Distinct Subsequences · 17 lines
- Distinct Subsequences II · 7 lines
- Distribute Candies · 4 lines
- Distribute Candies to People · 19 lines
- Distribute Coins in Binary Tree · 23 lines
- Distribute Repeating Integers · 24 lines
- DI String Match · 14 lines
- Divide Array in Sets of K Consecutive Numbers · 35 lines
- Divide Array Into Equal Pairs · 7 lines
- Divide a String Into Groups of Size k · 3 lines
- Divide Two Integers · 44 lines
- Divisor Game · 3 lines
- Domino and Tromino Tiling · 9 lines
- Dota2 Senate · 21 lines
- Dungeon Game · 17 lines
- Duplicate Zeros · 14 lines
- Earliest Possible Day of Full Bloom · 11 lines
- Edit Distance · 24 lines
- Egg Drop With 2 Eggs and N Floors · 3 lines
- Element Appearing More Than 25% In Sorted Array · 12 lines
- Eliminate Maximum Number of Monsters · 6 lines
- Elimination Game · 15 lines
- Employee Importance · 45 lines
- Encode and Decode TinyURL · 7 lines
- Encrypt and Decrypt Strings · 18 lines
- Equal Rational Numbers · 45 lines
- Equal Row and Column Pairs · 17 lines
- Equal Sum Arrays With Minimum Number of Operations · 38 lines
- Erect the Fence · 49 lines
- Escape a Large Maze · 332 lines
- Escape The Ghosts · 6 lines
- Escape the Spreading Fire · 31 lines
- Evaluate Boolean Binary Tree · 14 lines
- Evaluate Division · 37 lines
- Evaluate Reverse Polish Notation · 16 lines
- Evaluate the Bracket Pairs of a String · 13 lines
- Even Odd Tree · 39 lines
- Exam Room · 89 lines
- Excel Sheet Column Number · 12 lines
- Excel Sheet Column Title · 14 lines
- Exclusive Time of Functions · 35 lines
- Execution of All Suffix Instructions Staying in a Grid · 29 lines
- Expression Add Operators · 57 lines
- Expressive Words · 38 lines
- Factorial Trailing Zeroes · 8 lines
- Fair Candy Swap · 55 lines
- Fair Distribution of Cookies · 18 lines
- Falling Squares · 54 lines
- Fancy Sequence · 65 lines
- Fibonacci Number · 9 lines
- Filling Bookcase Shelves · 25 lines
- Filter Restaurants by Vegan-Friendly, Price and Distance · 15 lines
- Final Prices With a Special Discount in a Shop · 8 lines
- Final Value of Variable After Performing Operations · 10 lines
- Find a Corresponding Node of a Binary Tree in a Clone of That Tree · 20 lines
- Find All Anagrams in a String · 26 lines
- Find All Duplicates in an Array · 15 lines
- Find All Good Strings · 52 lines
- Find All Groups of Farmland · 37 lines
- Find All K-Distant Indices in an Array · 16 lines
- Find All Lonely Numbers in the Array · 5 lines
- Find All Numbers Disappeared in an Array · 3 lines
- Find All People With Secret · 55 lines
- Find All Possible Recipes from Given Supplies · 25 lines
- Find And Replace in String · 20 lines
- Find and Replace Pattern · 29 lines
- Find a Peak Element II · 24 lines
- Find Array Given Subset Sums · 28 lines
- Find a Value of a Mysterious Function Closest to Target · 10 lines
- Find Bottom Left Tree Value · 33 lines
- Find Center of Star Graph · 16 lines
- Find Closest Node to Given Two Nodes · 42 lines
- Find Closest Number to Zero · 108 lines
- Find Common Characters · 28 lines
- Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree · 56 lines
- Find Duplicate File in System · 46 lines
- Find Duplicate Subtrees · 24 lines
- Find Elements in a Contaminated Binary Tree · 32 lines
- Find Eventual Safe States · 41 lines
- Find First and Last Position of Element in Sorted Array · 24 lines
- Find First Palindromic String in the Array · 6 lines
- Find Good Days to Rob the Bank · 15 lines
- Find Greatest Common Divisor of Array · 12 lines
- Find if Path Exists in Graph · 41 lines
- Finding 3-Digit Even Numbers · 16 lines
- Finding MK Average · 62 lines
- Finding Pairs With a Certain Sum · 21 lines
- Finding the Users Active Minutes · 18 lines
- Find in Mountain Array · 51 lines
- Find K Closest Elements · 18 lines
- Find K Pairs with Smallest Sums · 29 lines
- Find Kth Bit in Nth Binary String · 6 lines
- Find Kth Largest XOR Coordinate Value · 33 lines
- Find K-th Smallest Pair Distance · 18 lines
- Find Largest Value in Each Tree Row · 23 lines
- Find Latest Group of Size M · 25 lines
- Find Longest Awesome Substring · 25 lines
- Find Lucky Integer in an Array · 14 lines
- Find Median from Data Stream · 32 lines
- Find Minimum in Rotated Sorted Array · 19 lines
- Find Minimum in Rotated Sorted Array II · 3 lines
- Find Minimum Time to Finish All Jobs · 34 lines
- Find Missing Observations · 9 lines
- Find Mode in Binary Search Tree · 39 lines
- Find Nearest Point That Has the Same X or Y Coordinate · 12 lines
- Find Numbers with Even Number of Digits · 7 lines
- Find N Unique Integers Sum up to Zero · 7 lines
- Find Original Array From Doubled Array · 29 lines
- Find Palindrome With Fixed Length · 20 lines
- Find Peak Element · 19 lines
- Find Pivot Index · 14 lines
- Find Players With Zero or One Losses · 18 lines
- Find Resultant Array After Removing Anagrams · 10 lines
- Find Right Interval · 11 lines
- Find Servers That Handled Most Number of Requests · 19 lines
- Find Smallest Letter Greater Than Target · 11 lines
- Find Subsequence of Length K With the Largest Sum · 9 lines
- Find Substring With Given Hash Value · 11 lines
- Find Target Indices After Sorting Array · 7 lines
- Find the City With the Smallest Number of Neighbors at a Threshold Distance · 28 lines
- Find the Closest Palindrome · 0 lines
- Find the Difference · 8 lines
- Find the Difference of Two Arrays · 20 lines
- Find the Distance Value Between Two Arrays · 33 lines
- Find the Duplicate Number · 11 lines
- Find the Highest Altitude · 6 lines
- Find the K-Beauty of a Number · 18 lines
- Find the Kth Largest Integer in the Array · 4 lines
- Find the Kth Smallest Sum of a Matrix With Sorted Rows · 25 lines
- Find the Longest Substring Containing Vowels in Even Counts · 25 lines
- Find the Longest Valid Obstacle Course at Each Position · 14 lines
- Find the Middle Index in Array · 8 lines
- Find the Minimum and Maximum Number of Nodes Between Critical Points · 21 lines
- Find the Minimum Number of Fibonacci Numbers Whose Sum Is K · 11 lines
- Find the Most Competitive Subsequence · 11 lines
- Find the Shortest Superstring · 38 lines
- Find the Smallest Divisor Given a Threshold · 17 lines
- Find the Student that Will Replace the Chalk · 17 lines
- Find the Town Judge · 11 lines
- Find the Winner of an Array Game · 17 lines
- Find the Winner of the Circular Game · 9 lines
- Find Three Consecutive Integers That Sum to a Given Number · 7 lines
- Find Triangular Sum of an Array · 8 lines
- Find Two Non-overlapping Sub-arrays Each With Target Sum · 29 lines
- Find Unique Binary String · 7 lines
- Find Valid Matrix Given Row and Column Sums · 19 lines
- Find Winner on a Tic Tac Toe Game · 37 lines
- Find Words That Can Be Formed by Characters · 16 lines
- Find XOR Sum of All Pairs Bitwise AND · 7 lines
- First Bad Version · 8 lines
- First Day Where You Have Been in All the Rooms · 20 lines
- First Letter to Appear Twice · 7 lines
- First Missing Positive · 23 lines
- First Unique Character in a String · 8 lines
- Fizz Buzz · 13 lines
- Flatten a Multilevel Doubly Linked List · 38 lines
- Flatten Binary Tree to Linked List · 31 lines
- Flatten Nested List Iterator · 22 lines
- Flip Binary Tree To Match Preorder Traversal · 49 lines
- Flip Columns For Maximum Number of Equal Rows · 21 lines
- Flip Equivalent Binary Trees · 17 lines
- Flipping an Image · 3 lines
- Flip String to Monotone Increasing · 37 lines
- Flood Fill · 35 lines
- Flower Planting With No Adjacent · 14 lines
- Form Array by Concatenating Subarrays of Another Array · 16 lines
- Form Largest Integer With Digits That Add up to Target · 17 lines
- Four Divisors · 21 lines
- Fraction Addition and Subtraction · 54 lines
- Fraction to Recurring Decimal · 30 lines
- Freedom Trail · 22 lines
- Frequency of the Most Frequent Element · 11 lines
- Friends Of Appropriate Ages · 37 lines
- Frog Jump · 25 lines
- Frog Position After T Seconds · 24 lines
- Fruit Into Baskets · 29 lines
- Furthest Building You Can Reach · 17 lines
- Game of Life · 30 lines
- Gas Station · 20 lines
- Generate a String With Characters That Have Odd Counts · 13 lines
- Generate Parentheses · 27 lines
- Generate Random Point in a Circle · 18 lines
- Get Biggest Three Rhombus Sums in a Grid · 46 lines
- Get Equal Substrings Within Budget · 25 lines
- Get Maximum in Generated Array · 17 lines
- Get the Maximum Score · 27 lines
- Get Watched Videos by Your Friends · 26 lines
- Global and Local Inversions · 6 lines
- Goal Parser Interpretation · 3 lines
- Goat Latin · 15 lines
- Graph Connectivity With Threshold · 22 lines
- Gray Code · 14 lines
- Greatest Common Divisor of Strings · 28 lines
- Greatest English Letter in Upper and Lower Case · 9 lines
- Greatest Sum Divisible by Three · 32 lines
- Grid Game · 11 lines
- Grid Illumination · 46 lines
- Group Anagrams · 13 lines
- Groups of Special-Equivalent Strings · 5 lines
- Groups of Strings · 73 lines
- Group the People Given the Group Size They Belong To · 19 lines
- Grumpy Bookstore Owner · 42 lines
- Guess Number Higher or Lower · 13 lines
- Guess Number Higher or Lower II · 22 lines
- Guess the Word · 34 lines
- Hamming Distance · 13 lines
- Hand of Straights · 35 lines
- Happy Number · 10 lines
- Heaters · 25 lines
- Height Checker · 7 lines
- H-Index · 14 lines
- H-Index II · 9 lines
- House Robber · 17 lines
- House Robber II · 18 lines
- House Robber III · 20 lines
- How Many Numbers Are Smaller Than the Current Number · 4 lines
- HTML Entity Parser · 41 lines
- Image Overlap · 20 lines
- Image Smoother · 18 lines
- Implement Magic Dictionary · 32 lines
- Implement Queue using Stacks · 56 lines
- Implement Rand10() Using Rand7() · 11 lines
- Implement Stack using Queues · 27 lines
- Implement strStr() · 13 lines
- Implement Trie (Prefix Tree) · 47 lines
- Increasing Decreasing String · 12 lines
- Increasing Order Search Tree · 17 lines
- Increasing Subsequences · 15 lines
- Increasing Triplet Subsequence · 11 lines
- Incremental Memory Leak · 46 lines
- Insert Delete GetRandom O(1) · 19 lines
- Insert Delete GetRandom O(1) - Duplicates allowed · 23 lines
- Insert Interval · 17 lines
- Insert into a Binary Search Tree · 11 lines
- Insertion Sort List · 54 lines
- Insufficient Nodes in Root to Leaf Paths · 61 lines
- Integer Break · 8 lines
- Integer Replacement · 29 lines
- Integer to English Words · 55 lines
- Integer to Roman · 31 lines
- Interleaving String · 14 lines
- Intersection of Multiple Arrays · 5 lines
- Intersection of Two Arrays · 18 lines
- Intersection of Two Arrays II · 16 lines
- Intersection of Two Linked Lists · 35 lines
- Interval List Intersections · 93 lines
- Intervals Between Identical Elements · 64 lines
- Invalid Transactions · 48 lines
- Invert Binary Tree · 15 lines
- IPO · 24 lines
- Is Graph Bipartite? · 24 lines
- Island Perimeter · 17 lines
- Isomorphic Strings · 20 lines
- Is Subsequence · 14 lines
- Iterator for Combination · 28 lines
- Jewels and Stones · 11 lines
- Jump Game · 46 lines
- Jump Game II · 16 lines
- Jump Game III · 16 lines
- Jump Game IV · 29 lines
- Jump Game V · 19 lines
- Jump Game VI · 13 lines
- Jump Game VII · 20 lines
- K Closest Points to Origin · 51 lines
- K-Concatenation Maximum Sum · 12 lines
- K-diff Pairs in an Array · 22 lines
- K Divisible Elements Subarrays · 18 lines
- Keep Multiplying Found Values by Two · 5 lines
- Keyboard Row · 17 lines
- Keys and Rooms · 35 lines
- K Highest Ranked Items Within a Price Range · 29 lines
- Kids With the Greatest Number of Candies · 15 lines
- K Inverse Pairs Array · 20 lines
- Knight Dialer · 31 lines
- Knight Probability in Chessboard · 26 lines
- Koko Eating Bananas · 17 lines
- K Radius Subarray Averages · 18 lines
- K-Similar Strings · 34 lines
- Kth Ancestor of a Tree Node · 41 lines
- Kth Distinct String in an Array · 11 lines
- Kth Largest Element in an Array · 4 lines
- Kth Largest Element in a Stream · 19 lines
- Kth Missing Positive Number · 11 lines
- Kth Smallest Element in a BST · 25 lines
- Kth Smallest Element in a Sorted Matrix · 20 lines
- K-th Smallest in Lexicographical Order · 36 lines
- Kth Smallest Instructions · 19 lines
- Kth Smallest Number in Multiplication Table · 13 lines
- K-th Smallest Prime Fraction · 18 lines
- Kth Smallest Product of Two Sorted Arrays · 9 lines
- K-th Symbol in Grammar · 15 lines
- Largest 1-Bordered Square · 37 lines
- Largest 3-Same-Digit Number in String · 6 lines
- Largest Color Value in a Directed Graph · 76 lines
- Largest Combination With Bitwise AND Greater Than Zero · 4 lines
- Largest Component Size by Common Factor · 42 lines
- Largest Divisible Subset · 29 lines
- Largest Magic Square · 32 lines
- Largest Merge Of Two Strings · 16 lines
- Largest Multiple of Three · 29 lines
- Largest Number · 20 lines
- Largest Number After Digit Swaps by Parity · 19 lines
- Largest Number After Mutating Substring · 13 lines
- Largest Number At Least Twice of Others · 11 lines
- Largest Odd Number in String · 11 lines
- Largest Palindrome Product · 15 lines
- Largest Perimeter Triangle · 10 lines
- Largest Plus Sign · 44 lines
- Largest Rectangle in Histogram · 17 lines
- Largest Submatrix With Rearrangements · 31 lines
- Largest Substring Between Two Equal Characters · 9 lines
- Largest Sum of Averages · 15 lines
- Largest Time for Given Digits · 52 lines
- Largest Triangle Area · 14 lines
- Largest Values From Labels · 38 lines
- Last Day Where You Can Still Cross · 50 lines
- Last Moment Before All Ants Fall Out of a Plank · 8 lines
- Last Stone Weight · 15 lines
- Last Stone Weight II · 17 lines
- Last Substring in Lexicographical Order · 20 lines
- Latest Time by Replacing Hidden Digits · 31 lines
- Leaf-Similar Trees · 27 lines
- Least Number of Unique Integers after K Removals · 26 lines
- Least Operators to Express Number · 26 lines
- Lemonade Change · 17 lines
- Length of Last Word · 3 lines
- Length of Longest Fibonacci Subsequence · 17 lines
- Letter Case Permutation · 14 lines
- Letter Combinations of a Phone Number · 45 lines
- Letter Tile Possibilities · 8 lines
- Lexicographically Smallest String After Applying Operations · 53 lines
- Lexicographical Numbers · 18 lines
- LFU Cache · 112 lines
- License Key Formatting · 15 lines
- Linked List Components · 16 lines
- Linked List Cycle · 8 lines
- Linked List Cycle II · 23 lines
- Linked List in Binary Tree · 19 lines
- Linked List Random Node · 9 lines
- Longer Contiguous Segments of Ones than Zeros · 8 lines
- Longest Absolute File Path · 27 lines
- Longest Arithmetic Subsequence · 9 lines
- Longest Arithmetic Subsequence of Given Difference · 10 lines
- Longest Binary Subsequence Less Than or Equal to K · 7 lines
- Longest Chunked Palindrome Decomposition · 20 lines
- Longest Common Prefix · 20 lines
- Longest Common Subpath · 49 lines
- Longest Common Subsequence · 19 lines
- Longest Consecutive Sequence · 14 lines
- Longest Continuous Increasing Subsequence · 17 lines
- Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit · 39 lines
- Longest Cycle in a Graph · 24 lines
- Longest Duplicate Substring · 19 lines
- Longest Happy Prefix · 17 lines
- Longest Happy String · 28 lines
- Longest Harmonious Subsequence · 20 lines
- Longest Ideal Subsequence · 7 lines
- Longest Increasing Path in a Matrix · 22 lines
- Longest Increasing Subsequence · 48 lines
- Longest Mountain in Array · 22 lines
- Longest Nice Substring · 25 lines
- Longest Palindrome · 21 lines
- Longest Palindrome by Concatenating Two Letter Words · 18 lines
- Longest Palindromic Subsequence · 15 lines
- Longest Palindromic Substring · 15 lines
- Longest Path With Different Adjacent Characters · 19 lines
- Longest Repeating Character Replacement · 24 lines
- Longest String Chain · 21 lines
- Longest Subarray of 1's After Deleting One Element · 31 lines
- Longest Subsequence Repeated k Times · 36 lines
- Longest Substring Of All Vowels in Order · 14 lines
- Longest Substring of One Repeating Character · 62 lines
- Longest Substring with At Least K Repeating Characters · 28 lines
- Longest Substring Without Repeating Characters · 14 lines
- Longest Turbulent Subarray · 22 lines
- Longest Uncommon Subsequence I · 8 lines
- Longest Uncommon Subsequence II · 19 lines
- Longest Univalue Path · 25 lines
- Longest Valid Parentheses · 18 lines
- Longest Well-Performing Interval · 69 lines
- Longest Word in Dictionary · 21 lines
- Longest Word in Dictionary through Deleting · 18 lines
- Longest ZigZag Path in a Binary Tree · 18 lines
- Long Pressed Name · 31 lines
- Loud and Rich · 27 lines
- Lowest Common Ancestor of a Binary Search Tree · 13 lines
- Lowest Common Ancestor of a Binary Tree · 17 lines
- Lowest Common Ancestor of Deepest Leaves · 32 lines
- LRU Cache · 35 lines
- Lucky Numbers in a Matrix · 31 lines
- Magical String · 12 lines
- Magic Squares In Grid · 30 lines
- Magnetic Force Between Two Balls · 27 lines
- Majority Element · 9 lines
- Majority Element II · 55 lines
- Make Array Strictly Increasing · 27 lines
- Make Array Zero by Subtracting Equal Amounts · 3 lines
- Make Sum Divisible by P · 16 lines
- Make The String Great · 16 lines
- Make Two Arrays Equal by Reversing Sub-arrays · 9 lines
- Making A Large Island · 80 lines
- Making File Names Unique · 23 lines
- Map of Highest Peak · 20 lines
- Map Sum Pairs · 33 lines
- Masking Personal Information · 63 lines
- Matchsticks to Square · 24 lines
- Match Substring After Replacement · 20 lines
- Matrix Block Sum · 27 lines
- Matrix Cells in Distance Order · 18 lines
- Matrix Diagonal Sum · 22 lines
- Max Area of Island · 27 lines
- Max Chunks To Make Sorted · 11 lines
- Max Chunks To Make Sorted II · 20 lines
- Max Consecutive Ones · 13 lines
- Max Consecutive Ones III · 11 lines
- Max Difference You Can Get From Changing an Integer · 14 lines
- Max Dot Product of Two Subsequences · 12 lines
- Maximal Network Rank · 14 lines
- Maximal Rectangle · 47 lines
- Maximal Square · 22 lines
- Maximize Distance to Closest Person · 19 lines
- Maximize Grid Happiness · 52 lines
- Maximize Number of Nice Divisors · 11 lines
- Maximize Number of Subsequences in a String · 11 lines
- Maximize Palindrome Length From Subsequences · 17 lines
- Maximize Score After N Operations · 29 lines
- Maximize Sum Of Array After K Negations · 12 lines
- Maximize the Confusion of an Exam · 37 lines
- Maximize the Topmost Element After K Moves · 21 lines
- Maximum 69 Number · 8 lines
- Maximum Absolute Sum of Any Subarray · 9 lines
- Maximum Alternating Subsequence Sum · 16 lines
- Maximum AND Sum of Array · 25 lines
- Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts · 22 lines
- Maximum Ascending Subarray Sum · 11 lines
- Maximum Average Pass Ratio · 47 lines
- Maximum Average Subarray I · 41 lines
- Maximum Bags With Full Capacity of Rocks · 19 lines
- Maximum Binary String After Change · 11 lines
- Maximum Binary Tree · 10 lines
- Maximum Binary Tree II · 42 lines
- Maximum Building Height · 49 lines
- Maximum Candies Allocated to K Children · 24 lines
- Maximum Candies You Can Get from Boxes · 28 lines
- Maximum Compatibility Score Sum · 40 lines
- Maximum Consecutive Floors Without Special Floors · 10 lines
- Maximum Depth of Binary Tree · 19 lines
- Maximum Depth of N-ary Tree · 10 lines
- Maximum Difference Between Increasing Elements · 8 lines
- Maximum Difference Between Node and Ancestor · 15 lines
- Maximum Distance Between a Pair of Values · 10 lines
- Maximum Earnings From Taxi · 18 lines
- Maximum Element After Decreasing and Rearranging · 18 lines
- Maximum Employees to Be Invited to a Meeting · 40 lines
- Maximum Equal Frequency · 42 lines
- Maximum Erasure Value · 19 lines
- Maximum Frequency Stack · 28 lines
- Maximum Fruits Harvested After at Most K Steps · 20 lines
- Maximum Gap · 39 lines
- Maximum Genetic Difference Query · 50 lines
- Maximum Good People Based on Statements · 26 lines
- Maximum Height by Stacking Cuboids · 22 lines
- Maximum Ice Cream Bars · 11 lines
- Maximum Length of a Concatenated String with Unique Characters · 49 lines
- Maximum Length of Pair Chain · 34 lines
- Maximum Length of Repeated Subarray · 12 lines
- Maximum Length of Subarray With Positive Product · 20 lines
- Maximum Level Sum of a Binary Tree · 20 lines
- Maximum Matrix Sum · 14 lines
- Maximum Nesting Depth of the Parentheses · 10 lines
- Maximum Nesting Depth of Two Valid Parentheses Strings · 14 lines
- Maximum Non Negative Product in a Matrix · 23 lines
- Maximum Number of Achievable Transfer Requests · 24 lines
- Maximum Number of Balloons · 15 lines
- Maximum Number of Balls in a Box · 12 lines
- Maximum Number of Coins You Can Get · 12 lines
- Maximum Number of Consecutive Values You Can Make · 14 lines
- Maximum Number of Darts Inside of a Circular Dartboard · 71 lines
- Maximum Number of Eaten Apples · 29 lines
- Maximum Number of Events That Can Be Attended · 34 lines
- Maximum Number of Events That Can Be Attended II · 32 lines
- Maximum Number of Groups Getting Fresh Donuts · 34 lines
- Maximum Number of Non-Overlapping Subarrays With Sum Equals Target · 22 lines
- Maximum Number of Non-Overlapping Substrings · 32 lines
- Maximum Number of Occurrences of a Substring · 52 lines
- Maximum Number of Pairs in Array · 10 lines
- Maximum Number of Points with Cost · 15 lines
- Maximum Number of Removable Characters · 22 lines
- Maximum Number of Tasks You Can Assign · 43 lines
- Maximum Number of Visible Points · 26 lines
- Maximum Number of Vowels in a Substring of Given Length · 28 lines
- Maximum Number of Ways to Partition an Array · 24 lines
- Maximum Number of Weeks for Which You Can Work · 4 lines
- Maximum Number of Words Found in Sentences · 8 lines
- Maximum Number of Words You Can Type · 13 lines
- Maximum of Absolute Value Expression · 43 lines
- Maximum Path Quality of a Graph · 41 lines
- Maximum Performance of a Team · 23 lines
- Maximum Points in an Archery Competition · 32 lines
- Maximum Points You Can Obtain from Cards · 16 lines
- Maximum Population Year · 22 lines
- Maximum Product After K Increments · 12 lines
- Maximum Product Difference Between Two Pairs · 17 lines
- Maximum Product of Splitted Binary Tree · 29 lines
- Maximum Product of the Length of Two Palindromic Subsequences · 21 lines
- Maximum Product of the Length of Two Palindromic Substrings · 34 lines
- Maximum Product of Three Numbers · 17 lines
- Maximum Product of Two Elements in an Array · 12 lines
- Maximum Product of Word Lengths · 19 lines
- Maximum Product Subarray · 20 lines
- Maximum Profit in Job Scheduling · 20 lines
- Maximum Profit of Operating a Centennial Wheel · 41 lines
- Maximum Repeating Substring · 16 lines
- Maximum Running Time of N Computers · 9 lines
- Maximum Score After Splitting a String · 31 lines
- Maximum Score from Performing Multiplication Operations · 20 lines
- Maximum Score From Removing Stones · 10 lines
- Maximum Score From Removing Substrings · 21 lines
- Maximum Score of a Good Subarray · 38 lines
- Maximum Score of a Node Sequence · 40 lines
- Maximum Score Of Spliced Array · 22 lines
- Maximum Score Words Formed by Letters · 20 lines
- Maximum Side Length of a Square with Sum Less than or Equal to Threshold · 33 lines
- Maximum Split of Positive Even Integers · 22 lines
- Maximum Students Taking Exam · 40 lines
- Maximum Subarray · 16 lines
- Maximum Subarray Sum with One Deletion · 37 lines
- Maximum Sum BST in Binary Tree · 29 lines
- Maximum Sum Circular Subarray · 45 lines
- Maximum Sum Obtained of Any Permutation · 18 lines
- Maximum Sum of 3 Non-Overlapping Subarrays · 26 lines
- Maximum Sum of Two Non-Overlapping Subarrays · 14 lines
- Maximum Swap · 22 lines
- Maximum Total Beauty of the Gardens · 52 lines
- Maximum Total Importance of Roads · 12 lines
- Maximum Trailing Zeros in a Cornered Path · 16 lines
- Maximum Twin Sum of a Linked List · 14 lines
- Maximum Units on a Truck · 11 lines
- Maximum Value after Insertion · 36 lines
- Maximum Value at a Given Index in a Bounded Array · 38 lines
- Maximum Value of K Coins From Piles · 22 lines
- Maximum White Tiles Covered by a Carpet · 20 lines
- Maximum Width of Binary Tree · 23 lines
- Maximum Width Ramp · 16 lines
- Maximum XOR After Operations · 6 lines
- Maximum XOR for Each Query · 10 lines
- Maximum XOR of Two Numbers in an Array · 29 lines
- Maximum XOR With an Element From Array · 39 lines
- Max Increase to Keep City Skyline · 12 lines
- Max Number of K-Sum Pairs · 18 lines
- Max Points on a Line · 21 lines
- Max Sum of a Pair With Equal Sum of Digits · 33 lines
- Max Sum of Rectangle No Larger Than K · 24 lines
- Max Value of Equation · 27 lines
- Mean of Array After Removing Some Elements · 8 lines
- Median of Two Sorted Arrays · 12 lines
- Merge BSTs to Create Single BST · 102 lines
- Merge In Between Linked Lists · 16 lines
- Merge Intervals · 12 lines
- Merge k Sorted Lists · 25 lines
- Merge Nodes in Between Zeros · 16 lines
- Merge Similar Items · 19 lines
- Merge Sorted Array · 17 lines
- Merge Strings Alternately · 20 lines
- Merge Triplets to Form Target Triplet · 9 lines
- Merge Two Binary Trees · 22 lines
- Merge Two Sorted Lists · 20 lines
- Middle of the Linked List · 8 lines
- Min Cost Climbing Stairs · 13 lines
- Min Cost to Connect All Points · 35 lines
- Minesweeper · 39 lines
- Minimize Deviation in Array · 30 lines
- Minimized Maximum of Products Distributed to Any Store · 13 lines
- Minimize Hamming Distance After Swap Operations · 36 lines
- Minimize Malware Spread · 54 lines
- Minimize Malware Spread II · 32 lines
- Minimize Maximum Pair Sum in Array · 7 lines
- Minimize Result by Adding Parentheses to Expression · 20 lines
- Minimize the Difference Between Target and Chosen Elements · 45 lines
- Minimum Absolute Difference · 13 lines
- Minimum Absolute Difference in BST · 17 lines
- Minimum Absolute Difference Queries · 25 lines
- Minimum Absolute Sum Difference · 26 lines
- Minimum Add to Make Parentheses Valid · 12 lines
- Minimum Adjacent Swaps for K Consecutive Ones · 37 lines
- Minimum Adjacent Swaps to Reach the Kth Smallest Number · 30 lines
- Minimum Amount of Time to Fill Cups · 12 lines
- Minimum Area Rectangle · 21 lines
- Minimum Area Rectangle II · 45 lines
- Minimum ASCII Delete Sum for Two Strings · 20 lines
- Minimum Average Difference · 25 lines
- Minimum Bit Flips to Convert Number · 8 lines
- Minimum Changes To Make Alternating Binary String · 19 lines
- Minimum Consecutive Cards to Pick Up · 13 lines
- Minimum Cost For Tickets · 14 lines
- Minimum Cost Homecoming of a Robot in a Grid · 20 lines
- Minimum Cost of Buying Candies With Discount · 9 lines
- Minimum Cost to Change the Final Value of Expression · 38 lines
- Minimum Cost to Connect Two Groups of Points · 13 lines
- Minimum Cost to Cut a Stick · 16 lines
- Minimum Cost to Hire K Workers · 21 lines
- Minimum Cost to Make at Least One Valid Path in a Grid · 28 lines
- Minimum Cost to Move Chips to The Same Position · 10 lines
- Minimum Cost to Reach Destination in Time · 25 lines
- Minimum Cost to Set Cooking Time · 43 lines
- Minimum Cost Tree From Leaf Values · 35 lines
- Minimum Degree of a Connected Trio in a Graph · 18 lines
- Minimum Deletions to Make Array Beautiful · 30 lines
- Minimum Deletions to Make Array Divisible · 5 lines
- Minimum Deletions to Make Character Frequencies Unique · 18 lines
- Minimum Deletions to Make String Balanced · 24 lines
- Minimum Depth of Binary Tree · 22 lines
- Minimum Difference Between Highest and Lowest of K Scores · 10 lines
- Minimum Difference Between Largest and Smallest Value in Three Moves · 13 lines
- Minimum Difference in Sums After Removal of Elements · 31 lines
- Minimum Difficulty of a Job Schedule · 36 lines
- Minimum Distance Between BST Nodes · 23 lines
- Minimum Distance to the Target Element · 13 lines
- Minimum Distance to Type a Word Using Two Fingers · 30 lines
- Minimum Domino Rotations For Equal Row · 13 lines
- Minimum Elements to Add to Form a Given Sum · 3 lines
- Minimum Falling Path Sum · 20 lines
- Minimum Falling Path Sum II · 16 lines
- Minimum Flips to Make a OR b Equal to c · 19 lines
- Minimum Garden Perimeter to Collect Enough Apples · 26 lines
- Minimum Genetic Mutation · 32 lines
- Minimum Height Trees · 31 lines
- Minimum Incompatibility · 26 lines
- Minimum Increment to Make Array Unique · 14 lines
- Minimum Index Sum of Two Lists · 35 lines
- Minimum Initial Energy to Finish Tasks · 20 lines
- Minimum Insertion Steps to Make a String Palindrome · 17 lines
- Minimum Insertions to Balance a Parentheses String · 22 lines
- Minimum Interval to Include Each Query · 35 lines
- Minimum Jumps to Reach Home · 15 lines
- Minimum Length of String After Deleting Similar Ends · 6 lines
- Minimum Limit of Balls in a Bag · 10 lines
- Minimum Lines to Represent a Line Chart · 70 lines
- Minimum Moves to Convert String · 10 lines
- Minimum Moves to Equal Array Elements · 3 lines
- Minimum Moves to Equal Array Elements II · 17 lines
- Minimum Moves to Make Array Complementary · 19 lines
- Minimum Moves to Move a Box to Their Target Location · 64 lines
- Minimum Moves to Reach Target Score · 10 lines
- Minimum Moves to Reach Target with Rotations · 31 lines
- Minimum Non-Zero Product of the Array Elements · 4 lines
- Minimum Number of Arrows to Burst Balloons · 11 lines
- Minimum Number of Buckets Required to Collect Rainwater from Houses · 19 lines
- Minimum Number of Days to Disconnect Island · 69 lines
- Minimum Number of Days to Eat N Oranges · 17 lines
- Minimum Number of Days to Make m Bouquets · 72 lines
- Minimum Number of Flips to Convert Binary Matrix to Zero Matrix · 40 lines
- Minimum Number of Flips to Make the Binary String Alternating · 20 lines
- Minimum Number of Frogs Croaking · 34 lines
- Minimum Number of Increments on Subarrays to Form a Target Array · 8 lines
- Minimum Number of K Consecutive Bit Flips · 20 lines
- Minimum Number of Moves to Make Palindrome · 22 lines
- Minimum Number of Moves to Seat Everyone · 5 lines
- Minimum Number of Operations to Convert Time · 16 lines
- Minimum Number of Operations to Make Array Continuous · 14 lines
- Minimum Number of Operations to Make String Sorted · 19 lines
- Minimum Number of Operations to Move All Balls to Each Box · 16 lines
- Minimum Number of Operations to Reinitialize a Permutation · 11 lines
- Minimum Number of People to Teach · 38 lines
- Minimum Number of Refueling Stops · 12 lines
- Minimum Number of Removals to Make Mountain Array · 26 lines
- Minimum Number of Steps to Make Two Strings Anagram · 7 lines
- Minimum Number of Steps to Make Two Strings Anagram II · 22 lines
- Minimum Number of Swaps to Make the Binary String Alternating · 27 lines
- Minimum Number of Swaps to Make the String Balanced · 9 lines
- Minimum Number of Taps to Open to Water a Garden · 18 lines
- Minimum Number of Vertices to Reach All Nodes · 11 lines
- Minimum Number of Work Sessions to Finish the Tasks · 17 lines
- Minimum Numbers of Function Calls to Make Target Array · 16 lines
- Minimum Obstacle Removal to Reach Corner · 23 lines
- Minimum One Bit Operations to Make Integers Zero · 17 lines
- Minimum Operations to Convert Number · 21 lines
- Minimum Operations to Halve Array Sum · 24 lines
- Minimum Operations to Make Array Equal · 4 lines
- Minimum Operations to Make a Subsequence · 17 lines
- Minimum Operations to Make a Uni-Value Grid · 38 lines
- Minimum Operations to Make the Array Alternating · 26 lines
- Minimum Operations to Make the Array Increasing · 13 lines
- Minimum Operations to Make the Array K-Increasing · 12 lines
- Minimum Operations to Reduce X to Zero · 18 lines
- Minimum Path Cost in a Grid · 26 lines
- Minimum Path Sum · 21 lines
- Minimum Possible Integer After at Most K Adjacent Swaps On Digits · 23 lines
- Minimum Remove to Make Valid Parentheses · 18 lines
- Minimum Replacements to Sort the Array · 16 lines
- Minimum Rounds to Complete All Tasks · 20 lines
- Minimum Score After Removals on a Tree · 46 lines
- Minimum Score Triangulation of Polygon · 23 lines
- Minimum Sideway Jumps · 36 lines
- Minimum Size Subarray Sum · 23 lines
- Minimum Skips to Arrive at Meeting On Time · 20 lines
- Minimum Space Wasted From Packaging · 30 lines
- Minimum Speed to Arrive on Time · 27 lines
- Minimum Subsequence in Non-Increasing Order · 9 lines
- Minimum Suffix Flips · 10 lines
- Minimum Sum of Four Digit Number After Splitting Digits · 5 lines
- Minimum Sum of Squared Difference · 47 lines
- Minimum Swaps to Arrange a Binary Grid · 26 lines
- Minimum Swaps to Group All 1's Together II · 15 lines
- Minimum Swaps To Make Sequences Increasing · 27 lines
- Minimum Swaps to Make Strings Equal · 15 lines
- Minimum Time Difference · 18 lines
- Minimum Time to Collect All Apples in a Tree · 27 lines
- Minimum Time to Complete Trips · 24 lines
- Minimum Time to Finish the Race · 56 lines
- Minimum Time to Make Rope Colorful · 14 lines
- Minimum Time to Remove All Cars Containing Illegal Goods · 14 lines
- Minimum Time to Type Word Using Special Typewriter · 9 lines
- Minimum Time Visiting All Points · 16 lines
- Minimum Total Space Wasted With K Resizing Operations · 29 lines
- Minimum Value to Get Positive Step by Step Sum · 6 lines
- Minimum Weighted Subgraph With the Required Paths · 27 lines
- Minimum White Tiles After Covering With Carpets · 69 lines
- Minimum Window Substring · 43 lines
- Minimum XOR Sum of Two Arrays · 14 lines
- Mini Parser · 33 lines
- Min Max Game · 16 lines
- Min Stack · 27 lines
- Mirror Reflection · 9 lines
- Missing Number · 12 lines
- Monotone Increasing Digits · 14 lines
- Monotonic Array · 15 lines
- Most Beautiful Item for Each Query · 23 lines
- Most Common Word · 22 lines
- Most Frequent Number Following Key In an Array · 7 lines
- Most Frequent Subtree Sum · 27 lines
- Most Profit Assigning Work · 51 lines
- Most Stones Removed with Same Row or Column · 26 lines
- Most Visited Sector in a Circular Track · 48 lines
- Move Pieces to Obtain a String · 10 lines
- Move Zeroes · 15 lines
- Moving Stones Until Consecutive · 12 lines
- Moving Stones Until Consecutive II · 96 lines
- Multiply Strings · 14 lines
- My Calendar I · 10 lines
- My Calendar II · 93 lines
- My Calendar III · 20 lines
- Naming a Company · 22 lines
- N-ary Tree Level Order Traversal · 20 lines
- N-ary Tree Postorder Traversal · 18 lines
- N-ary Tree Preorder Traversal · 18 lines
- Nearest Exit from Entrance in Maze · 21 lines
- Network Delay Time · 37 lines
- New 21 Game · 10 lines
- Next Greater Element I · 12 lines
- Next Greater Element II · 12 lines
- Next Greater Element III · 19 lines
- Next Greater Node In Linked List · 18 lines
- Next Greater Numerically Balanced Number · 28 lines
- Next Permutation · 37 lines
- Nim Game · 3 lines
- Non-decreasing Array · 14 lines
- Non-negative Integers without Consecutive Ones · 30 lines
- Non-overlapping Intervals · 25 lines
- N-Queens · 35 lines
- N-Queens II · 33 lines
- N-Repeated Element in Size 2N Array · 3 lines
- Nth Digit · 34 lines
- Nth Magical Number · 18 lines
- N-th Tribonacci Number · 13 lines
- Number Complement · 9 lines
- Number of 1 Bits · 9 lines
- Number of Arithmetic Triplets · 10 lines
- Number of Atoms · 48 lines
- Number of Boomerangs · 19 lines
- Number of Burgers with No Waste of Ingredients · 13 lines
- Number of Closed Islands · 40 lines
- Number of Days Between Two Dates · 6 lines
- Number of Dice Rolls With Target Sum · 36 lines
- Number of Different Integers in a String · 6 lines
- Number of Different Subsequences GCDs · 19 lines
- Number of Digit One · 20 lines
- Number of Distinct Roll Sequences · 27 lines
- Number of Enclaves · 29 lines
- Number of Equivalent Domino Pairs · 21 lines
- Number of Excellent Pairs · 17 lines
- Number of Flowers in Full Bloom · 36 lines
- Number of Good Leaf Nodes Pairs · 33 lines
- Number of Good Pairs · 25 lines
- Number of Good Ways to Split a String · 20 lines
- Number of Increasing Paths in a Grid · 30 lines
- Number of Islands · 32 lines
- Number of Laser Beams in a Bank · 10 lines
- Number of Lines To Write String · 15 lines
- Number of Longest Increasing Subsequence · 40 lines
- Number of Matching Subsequences · 19 lines
- Number of Music Playlists · 13 lines
- Number of Nodes in the Sub-Tree With the Same Label · 29 lines
- Number of Operations to Make Network Connected · 46 lines
- Number of Orders in the Backlog · 32 lines
- Number of Pairs of Interchangeable Rectangles · 9 lines
- Number of Pairs of Strings With Concatenation Equal to Target · 3 lines
- Number of Paths with Max Score · 54 lines
- Number of People Aware of a Secret · 19 lines
- Number of Provinces · 25 lines
- Number of Recent Calls · 18 lines
- Number Of Rectangles That Can Form The Largest Square · 26 lines
- Number of Restricted Paths From First to Last Node · 64 lines
- Number of Segments in a String · 3 lines
- Number of Sets of K Non-Overlapping Line Segments · 18 lines
- Number of Smooth Descent Periods of a Stock · 33 lines
- Number of Squareful Arrays · 40 lines
- Number of Steps to Reduce a Number in Binary Representation to One · 12 lines
- Number of Steps to Reduce a Number to Zero · 11 lines
- Number of Strings That Appear as Substrings in Word · 3 lines
- Number of Students Doing Homework at a Given Time · 10 lines
- Number of Students Unable to Eat Lunch · 16 lines
- Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold · 13 lines
- Number of Subarrays with Bounded Maximum · 21 lines
- Number of Sub-arrays With Odd Sum · 15 lines
- Number of Submatrices That Sum to Target · 47 lines
- Number of Subsequences That Satisfy the Given Sum Condition · 18 lines
- Number of Substrings Containing All Three Characters · 17 lines
- Number of Substrings With Only 1s · 13 lines
- Number of Times Binary String Is Prefix-Aligned · 14 lines
- Number of Unique Good Subsequences · 25 lines
- Number of Valid Move Combinations On Chessboard · 49 lines
- Number of Valid Words for Each Puzzle · 32 lines
- Number of Valid Words in a Sentence · 25 lines
- Number of Visible People in a Queue · 27 lines
- Number of Ways of Cutting a Pizza · 58 lines
- Number of Ways to Arrive at Destination · 21 lines
- Number of Ways to Buy Pens and Pencils · 5 lines
- Number of Ways to Divide a Long Corridor · 15 lines
- Number of Ways to Form a Target String Given a Dictionary · 27 lines
- Number of Ways to Paint N × 3 Grid · 10 lines
- Number of Ways to Rearrange Sticks With K Sticks Visible · 22 lines
- Number Of Ways To Reconstruct A Tree · 43 lines
- Number of Ways to Reorder Array to Get Same BST · 44 lines
- Number of Ways to Select Buildings · 29 lines
- Number of Ways to Separate Numbers · 28 lines
- Number of Ways to Split Array · 12 lines
- Number of Ways to Split a String · 46 lines
- Number of Ways to Stay in the Same Place After Some Steps · 18 lines
- Number of Ways to Wear Different Hats to Each Other · 48 lines
- Number of Ways Where Square of Number Is Equal to Product of Two Numbers · 21 lines
- Number of Wonderful Substrings · 10 lines
- Number of Zero-Filled Subarrays · 13 lines
- Numbers At Most N Given Digit Set · 27 lines
- Numbers With Repeated Digits · 25 lines
- Numbers With Same Consecutive Differences · 44 lines
- Occurrences After Bigram · 5 lines
- Odd Even Jump · 38 lines
- Odd Even Linked List · 15 lines
- Ones and Zeroes · 11 lines
- Online Election · 23 lines
- Online Majority Element In Subarray · 27 lines
- Online Stock Span · 19 lines
- Open the Lock · 31 lines
- Operations on Tree · 61 lines
- Optimal Division · 10 lines
- Orderly Queue · 11 lines
- Out of Boundary Paths · 31 lines
- Pacific Atlantic Water Flow · 54 lines
- Paint House III · 20 lines
- Painting a Grid With Three Different Colors · 55 lines
- Pairs of Songs With Total Durations Divisible by 60 · 8 lines
- Palindrome Linked List · 25 lines
- Palindrome Number · 4 lines
- Palindrome Pairs · 42 lines
- Palindrome Partitioning · 53 lines
- Palindrome Partitioning II · 21 lines
- Palindrome Partitioning III · 31 lines
- Palindrome Partitioning IV · 22 lines
- Palindromic Substrings · 21 lines
- Pancake Sorting · 31 lines
- Parallel Courses II · 57 lines
- Parallel Courses III · 24 lines
- Parse Lisp Expression · 56 lines
- Parsing A Boolean Expression · 69 lines
- Partition Array According to Given Pivot · 13 lines
- Partition Array for Maximum Sum · 25 lines
- Partition Array into Disjoint Intervals · 11 lines
- Partition Array Into Three Parts With Equal Sum · 17 lines
- Partition Array Into Two Arrays to Minimize Sum Difference · 17 lines
- Partition Array Such That Maximum Difference Is K · 16 lines
- Partition Equal Subset Sum · 12 lines
- Partitioning Into Minimum Number Of Deci-Binary Numbers · 4 lines
- Partition Labels · 23 lines
- Partition List · 33 lines
- Partition to K Equal Sum Subsets · 36 lines
- Pascal's Triangle · 14 lines
- Pascal's Triangle II · 18 lines
- Patching Array · 19 lines
- Path Crossing · 20 lines
- Path In Zigzag Labelled Binary Tree · 18 lines
- Path Sum · 15 lines
- Path Sum II · 17 lines
- Path Sum III · 15 lines
- Path with Maximum Gold · 56 lines
- Path with Maximum Probability · 23 lines
- Path With Minimum Effort · 21 lines
- Peak Index in a Mountain Array · 12 lines
- Peeking Iterator · 15 lines
- People Whose List of Favorite Companies Is Not a Subset of Another List · 24 lines
- Percentage of Letter in String · 3 lines
- Perfect Number · 10 lines
- Perfect Rectangle · 39 lines
- Perfect Squares · 18 lines
- Permutation in String · 36 lines
- Permutations · 3 lines
- Permutation Sequence · 16 lines
- Permutations II · 25 lines
- Pizza With 3n Slices · 22 lines
- Plates Between Candles · 13 lines
- Plus One · 10 lines
- Poor Pigs · 17 lines
- Populating Next Right Pointers in Each Node · 30 lines
- Populating Next Right Pointers in Each Node II · 98 lines
- Positions of Large Groups · 21 lines
- Possible Bipartition · 27 lines
- Powerful Integers · 17 lines
- Power of Four · 11 lines
- Power of Three · 3 lines
- Power of Two · 26 lines
- Pow(x, n) · 25 lines
- Predict the Winner · 31 lines
- Prefix and Suffix Search · 11 lines
- Preimage Size of Factorial Zeroes Function · 23 lines
- Previous Permutation With One Swap · 21 lines
- Prime Arrangements · 15 lines
- Prime Number of Set Bits in Binary Representation · 4 lines
- Prime Palindrome · 23 lines
- Print Binary Tree · 28 lines
- Print Words Vertically · 22 lines
- Prison Cells After N Days · 26 lines
- Probability of a Two Boxes Having The Same Number of Distinct Balls · 54 lines
- Process Restricted Friend Requests · 33 lines
- Process Tasks Using Servers · 16 lines
- Product of Array Except Self · 15 lines
- Product of the Last K Numbers · 16 lines
- Profitable Schemes · 21 lines
- Projection Area of 3D Shapes · 14 lines
- Pseudo-Palindromic Paths in a Binary Tree · 30 lines
- Push Dominoes · 44 lines
- Pyramid Transition Matrix · 30 lines
- Queens That Can Attack the King · 77 lines
- Queries on a Permutation With Key · 9 lines
- Queries on Number of Points Inside a Circle · 15 lines
- Query Kth Smallest Trimmed Number · 22 lines
- Queue Reconstruction by Height · 17 lines
- Rabbits in Forest · 26 lines
- Race Car · 22 lines
- Random Flip Matrix · 19 lines
- Random Pick Index · 33 lines
- Random Pick with Blacklist · 24 lines
- Random Pick with Weight · 23 lines
- Random Point in Non-overlapping Rectangles · 25 lines
- Range Addition II · 7 lines
- Range Frequency Queries · 9 lines
- Range Module · 43 lines
- Range Sum of BST · 15 lines
- Range Sum of Sorted Subarray Sums · 14 lines
- Range Sum Query 2D - Immutable · 31 lines
- Range Sum Query - Immutable · 14 lines
- Range Sum Query - Mutable · 21 lines
- Rank Teams by Votes · 38 lines
- Rank Transform of a Matrix · 28 lines
- Rank Transform of an Array · 8 lines
- Ransom Note · 20 lines
- Reachable Nodes In Subdivided Graph · 42 lines
- Reachable Nodes With Restrictions · 27 lines
- Reach a Number · 16 lines
- Reaching Points · 20 lines
- Rearrange Array Elements by Sign · 7 lines
- Rearrange Characters to Make Target String · 5 lines
- Rearrange Spaces Between Words · 10 lines
- Rearrange Words in a Sentence · 6 lines
- Reconstruct a 2-Row Binary Matrix · 25 lines
- Reconstruct Itinerary · 35 lines
- Reconstruct Original Digits from English · 22 lines
- Recover a Tree From Preorder Traversal · 50 lines
- Recover Binary Search Tree · 53 lines
- Recover the Original Array · 44 lines
- Rectangle Area · 21 lines
- Rectangle Area II · 48 lines
- Rectangle Overlap · 12 lines
- Redistribute Characters to Make All Strings Equal · 14 lines
- Reduce Array Size to The Half · 15 lines
- Reducing Dishes · 12 lines
- Reduction Operations to Make the Array Elements Equal · 9 lines
- Redundant Connection · 55 lines
- Redundant Connection II · 79 lines
- Reformat Date · 25 lines
- Reformat Phone Number · 16 lines
- Reformat The String · 30 lines
- Regions Cut By Slashes · 53 lines
- Regular Expression Matching · 19 lines
- Relative Ranks · 20 lines
- Relative Sort Array · 23 lines
- Remove All Adjacent Duplicates In String · 10 lines
- Remove All Adjacent Duplicates in String II · 17 lines
- Remove All Occurrences of a Substring · 7 lines
- Remove Boxes · 12 lines
- Remove Colored Pieces if Both Neighbors are the Same Color · 13 lines
- Remove Comments · 33 lines
- Remove Covered Intervals · 17 lines
- Remove Digit From Number to Maximize Result · 23 lines
- Remove Duplicate Letters · 20 lines
- Remove Duplicates from Sorted Array · 8 lines
- Remove Duplicates from Sorted Array II · 35 lines
- Remove Duplicates from Sorted List · 18 lines
- Remove Duplicates from Sorted List II · 28 lines
- Remove Element · 15 lines
- Remove Invalid Parentheses · 49 lines
- Remove K Digits · 31 lines
- Remove Linked List Elements · 21 lines
- Remove Max Number of Edges to Keep Graph Fully Traversable · 67 lines
- Remove Nth Node From End of List · 21 lines
- Remove One Element to Make the Array Strictly Increasing · 25 lines
- Remove Outermost Parentheses · 16 lines
- Remove Palindromic Subsequences · 3 lines
- Remove Stones to Minimize the Total · 8 lines
- Remove Sub-Folders from the Filesystem · 34 lines
- Remove Zero Sum Consecutive Nodes from Linked List · 30 lines
- Removing Minimum and Maximum From Array · 14 lines
- Removing Minimum Number of Magic Beans · 3 lines
- Reorder Data in Log Files · 20 lines
- Reordered Power of 2 · 11 lines
- Reorder List · 34 lines
- Reorder Routes to Make All Paths Lead to the City Zero · 25 lines
- Reorganize String · 19 lines
- Repeated DNA Sequences · 23 lines
- Repeated String Match · 16 lines
- Repeated Substring Pattern · 6 lines
- Replace All Digits with Characters · 16 lines
- Replace All ?'s to Avoid Consecutive Repeating Characters · 13 lines
- Replace Elements in an Array · 9 lines
- Replace Elements with Greatest Element on Right Side · 11 lines
- Replace Non-Coprime Numbers in Array · 9 lines
- Replace the Substring for Balanced String · 17 lines
- Replace Words · 81 lines
- Reshape the Matrix · 6 lines
- Restore IP Addresses · 29 lines
- Restore The Array · 60 lines
- Restore the Array From Adjacent Pairs · 29 lines
- Reveal Cards In Increasing Order · 21 lines
- Reverse Bits · 9 lines
- Reverse Integer · 24 lines
- Reverse Linked List · 17 lines
- Reverse Linked List II · 70 lines
- Reverse Nodes in Even Length Groups · 30 lines
- Reverse Nodes in k-Group · 59 lines
- Reverse Only Letters · 12 lines
- Reverse Pairs · 20 lines
- Reverse Prefix of Word · 17 lines
- Reverse String · 8 lines
- Reverse String II · 8 lines
- Reverse Subarray To Maximize Array Value · 53 lines
- Reverse Substrings Between Each Pair of Parentheses · 16 lines
- Reverse Vowels of a String · 17 lines
- Reverse Words in a String · 40 lines
- Reverse Words in a String III · 16 lines
- Richest Customer Wealth · 4 lines
- Rings and Rods · 9 lines
- RLE Iterator · 22 lines
- Robot Bounded In Circle · 41 lines
- Robot Return to Origin · 8 lines
- Roman to Integer · 15 lines
- Root Equals Sum of Children · 3 lines
- Rotate Array · 18 lines
- Rotated Digits · 25 lines
- Rotate Function · 13 lines
- Rotate Image · 19 lines
- Rotate List · 29 lines
- Rotate String · 11 lines
- Rotating the Box · 22 lines
- Rotting Oranges · 60 lines
- Running Sum of 1d Array · 14 lines
- Russian Doll Envelopes · 16 lines
- Same Tree · 13 lines
- Satisfiability of Equality Equations · 31 lines
- Score After Flipping Matrix · 43 lines
- Score of Parentheses · 17 lines
- Scramble String · 45 lines
- Search a 2D Matrix · 9 lines
- Search a 2D Matrix II · 16 lines
- Search in a Binary Search Tree · 26 lines
- Search in Rotated Sorted Array · 22 lines
- Search in Rotated Sorted Array II · 14 lines
- Search Insert Position · 6 lines
- Search Suggestions System · 10 lines
- Seat Reservation Manager · 11 lines
- Second Largest Digit in a String · 14 lines
- Second Minimum Node In a Binary Tree · 14 lines
- Second Minimum Time to Reach Destination · 34 lines
- Self Crossing · 17 lines
- Self Dividing Numbers · 11 lines
- Sell Diminishing-Valued Colored Balls · 19 lines
- Selling Pieces of Wood · 33 lines
- Sender With Largest Word Count · 18 lines
- Sentence Similarity III · 1 lines
- Sequential Digits · 17 lines
- Sequentially Ordinal Rank Tracker · 22 lines
- Serialize and Deserialize Binary Tree · 25 lines
- Serialize and Deserialize BST · 52 lines
- Set Intersection Size At Least Two · 10 lines
- Set Matrix Zeroes · 17 lines
- Set Mismatch · 16 lines
- Shift 2D Grid · 18 lines
- Shifting Letters · 18 lines
- Shopping Offers · 30 lines
- Short Encoding of Words · 37 lines
- Shortest Bridge · 38 lines
- Shortest Common Supersequence · 15 lines
- Shortest Completing Word · 14 lines
- Shortest Distance to a Character · 14 lines
- Shortest Impossible Sequence of Rolls · 14 lines
- Shortest Palindrome · 20 lines
- Shortest Path in a Grid with Obstacles Elimination · 31 lines
- Shortest Path in Binary Matrix · 38 lines
- Shortest Path to Get All Keys · 52 lines
- Shortest Path Visiting All Nodes · 27 lines
- Shortest Path with Alternating Colors · 38 lines
- Shortest Subarray to be Removed to Make Array Sorted · 23 lines
- Shortest Subarray with Sum at Least K · 26 lines
- Shortest Unsorted Continuous Subarray · 32 lines
- Shuffle an Array · 21 lines
- Shuffle String · 14 lines
- Shuffle the Array · 10 lines
- Sign of the Product of an Array · 3 lines
- Similar String Groups · 29 lines
- Simple Bank System · 43 lines
- Simplified Fractions · 9 lines
- Simplify Path · 26 lines
- Single Element in a Sorted Array · 21 lines
- Single Number · 12 lines
- Single Number II · 21 lines
- Single Number III · 4 lines
- Single-Threaded CPU · 24 lines
- Sliding Puzzle · 52 lines
- Sliding Window Maximum · 18 lines
- Sliding Window Median · 34 lines
- Slowest Key · 17 lines
- Smallest Good Base · 12 lines
- Smallest Index With Equal Value · 6 lines
- Smallest Integer Divisible by K · 16 lines
- Smallest K-Length Subsequence With Occurrences of a Letter · 28 lines
- Smallest Missing Genetic Value in Each Subtree · 29 lines
- Smallest Number in Infinite Set · 15 lines
- Smallest Range Covering Elements from K Lists · 36 lines
- Smallest Range I · 5 lines
- Smallest Range II · 11 lines
- Smallest Rotation with Highest Score · 24 lines
- Smallest String Starting From Leaf · 19 lines
- Smallest String With A Given Numeric Value · 20 lines
- Smallest String With Swaps · 56 lines
- Smallest Subsequence of Distinct Characters · 20 lines
- Smallest Subtree with all the Deepest Nodes · 64 lines
- Smallest Sufficient Team · 43 lines
- Smallest Value of the Rearranged Number · 15 lines
- Snakes and Ladders · 34 lines
- Snapshot Array · 19 lines
- Solve the Equation · 19 lines
- Solving Questions With Brainpower · 7 lines
- Sort an Array · 27 lines
- Sort Array by Increasing Frequency · 13 lines
- Sort Array By Parity · 11 lines
- Sort Array By Parity II · 14 lines
- Sort Characters By Frequency · 15 lines
- Sort Colors · 15 lines
- Sort Even and Odd Indices Independently · 11 lines
- Sorting the Sentence · 9 lines
- Sort Integers by The Number of 1 Bits · 16 lines
- Sort Integers by The Power Value · 25 lines
- Sort Items by Groups Respecting Dependencies · 66 lines
- Sort List · 16 lines
- Sort the Jumbled Numbers · 7 lines
- Sort the Matrix Diagonally · 6 lines
- Soup Servings · 25 lines
- Special Array With X Elements Greater Than or Equal X · 11 lines
- Special Binary String · 14 lines
- Special Positions in a Binary Matrix · 12 lines
- Spiral Matrix · 32 lines
- Spiral Matrix II · 26 lines
- Spiral Matrix III · 38 lines
- Spiral Matrix IV · 20 lines
- Split Array into Consecutive Subsequences · 52 lines
- Split Array into Fibonacci Sequence · 67 lines
- Split Array Largest Sum · 17 lines
- Split Array With Same Average · 21 lines
- Split a String in Balanced Strings · 14 lines
- Split a String Into the Max Number of Unique Substrings · 18 lines
- Split Linked List in Parts · 39 lines
- Splitting a String Into Descending Consecutive Values · 17 lines
- Split Two Strings to Make Palindrome · 33 lines
- Sqrt(x) · 14 lines
- Squares of a Sorted Array · 17 lines
- Stamping the Grid · 60 lines
- Stamping The Sequence · 27 lines
- Statistics from a Large Sample · 29 lines
- Step-By-Step Directions From a Binary Tree Node to Another · 20 lines
- Steps to Make Array Non-decreasing · 14 lines
- Stickers to Spell Word · 26 lines
- Stock Price Fluctuation · 40 lines
- Stone Game · 3 lines
- Stone Game II · 30 lines
- Stone Game III · 21 lines
- Stone Game IV · 12 lines
- Stone Game IX · 24 lines
- Stone Game V · 37 lines
- Stone Game VI · 7 lines
- Stone Game VII · 10 lines
- Stone Game VIII · 7 lines
- Strange Printer · 47 lines
- Strange Printer II · 85 lines
- Stream of Characters · 34 lines
- String Compression · 18 lines
- String Compression II · 59 lines
- String Matching in an Array · 9 lines
- String to Integer (atoi) · 56 lines
- String Without AAA or BBB · 45 lines
- Strong Password Checker · 42 lines
- Strong Password Checker II · 16 lines
- Student Attendance Record I · 17 lines
- Student Attendance Record II · 35 lines
- Subarray Product Less Than K · 19 lines
- Subarray Sum Equals K · 19 lines
- Subarray Sums Divisible by K · 22 lines
- Subarrays with K Different Integers · 26 lines
- Subarray With Elements Greater Than Varying Threshold · 12 lines
- Subdomain Visit Count · 25 lines
- Subrectangle Queries · 14 lines
- Subsets · 15 lines
- Subsets II · 16 lines
- Substring with Concatenation of All Words · 26 lines
- Substring With Largest Variance · 45 lines
- Subtract the Product and Sum of Digits of an Integer · 15 lines
- Subtree of Another Tree · 26 lines
- Successful Pairs of Spells and Potions · 24 lines
- Sudoku Solver · 59 lines
- Sum Game · 25 lines
- Summary Ranges · 29 lines
- Sum of Absolute Differences in a Sorted Array · 14 lines
- Sum of All Odd Length Subarrays · 9 lines
- Sum of All Subset XOR Totals · 9 lines
- Sum of Beauty in the Array · 21 lines
- Sum of Beauty of All Substrings · 16 lines
- Sum of Digits in Base K · 9 lines
- Sum of Digits of String After Convert · 7 lines
- Sum of Distances in Tree · 91 lines
- Sum of Even Numbers After Queries · 23 lines
- Sum of Floored Pairs · 17 lines
- Sum of k-Mirror Numbers · 60 lines
- Sum of Left Leaves · 13 lines
- Sum of Mutated Array Closest to Target · 29 lines
- Sum of Nodes with Even-Valued Grandparent · 11 lines
- Sum of Numbers With Units Digit K · 13 lines
- Sum of Root To Leaf Binary Numbers · 27 lines
- Sum of Scores of Built Strings · 16 lines
- Sum of Square Numbers · 18 lines
- Sum of Subarray Minimums · 17 lines
- Sum of Subarray Ranges · 41 lines
- Sum of Subsequence Widths · 16 lines
- Sum of Total Strength of Wizards · 34 lines
- Sum of Two Integers · 10 lines
- Sum of Unique Elements · 13 lines
- Sum Root to Leaf Numbers · 28 lines
- Super Egg Drop · 36 lines
- Super Palindromes · 52 lines
- Super Pow · 10 lines
- Super Ugly Number · 12 lines
- Super Washing Machines · 20 lines
- Surface Area of 3D Shapes · 21 lines
- Surrounded Regions · 49 lines
- Swap Adjacent in LR String · 18 lines
- Swap For Longest Repeated Character Substring · 57 lines
- Swap Nodes in Pairs · 19 lines
- Swapping Nodes in a Linked List · 30 lines
- Swim in Rising Water · 43 lines
- Symmetric Tree · 17 lines
- Tag Validator · 52 lines
- Tallest Billboard · 22 lines
- Target Sum · 14 lines
- Task Scheduler · 23 lines
- Task Scheduler II · 14 lines
- Teemo Attacking · 23 lines
- Text Justification · 40 lines
- The Earliest and Latest Rounds Where Players Compete · 82 lines
- The k Strongest Values in an Array · 14 lines
- The kth Factor of n · 14 lines
- The k-th Lexicographical String of All Happy Strings of Length n · 17 lines
- The K Weakest Rows in a Matrix · 11 lines
- The Latest Time to Catch a Bus · 19 lines
- The Number of Full Rounds You Have Played · 12 lines
- The Number of Good Subsets · 62 lines
- The Number of the Smallest Unoccupied Chair · 19 lines
- The Number of Weak Characters in the Game · 15 lines
- The Score of Students Solving Math Expression · 27 lines
- The Skyline Problem · 41 lines
- The Time When the Network Becomes Idle · 48 lines
- Third Maximum Number · 12 lines
- Thousand Separator · 32 lines
- Three Consecutive Odds · 12 lines
- Three Divisors · 3 lines
- Three Equal Parts · 31 lines
- Throne Inheritance · 52 lines
- Tiling a Rectangle with the Fewest Squares · 55 lines
- Time Based Key-Value Store · 46 lines
- Time Needed to Buy Tickets · 3 lines
- Time Needed to Inform All Employees · 23 lines
- Toeplitz Matrix · 28 lines
- To Lower Case · 16 lines
- Top K Frequent Elements · 3 lines
- Top K Frequent Words · 24 lines
- Total Appeal of A String · 7 lines
- Total Hamming Distance · 11 lines
- Transform to Chessboard · 36 lines
- Transpose Matrix · 9 lines
- Trapping Rain Water · 23 lines
- Trapping Rain Water II · 44 lines
- Tree of Coprimes · 40 lines
- Triangle · 21 lines
- Trim a Binary Search Tree · 11 lines
- Triples with Bitwise AND Equal To Zero · 18 lines
- Truncate Sentence · 4 lines
- Tuple with Same Product · 17 lines
- Tweet Counts Per Frequency · 35 lines
- Two Best Non-Overlapping Events · 14 lines
- Two City Scheduling · 31 lines
- Two Furthest Houses With Different Colors · 23 lines
- Two Out of Three · 17 lines
- Two Sum · 8 lines
- Two Sum II - Input Array Is Sorted · 14 lines
- Two Sum IV - Input is a BST · 26 lines
- Ugly Number · 13 lines
- Ugly Number II · 51 lines
- Ugly Number III · 14 lines
- Uncommon Words from Two Sentences · 12 lines
- Uncrossed Lines · 13 lines
- Unique Binary Search Trees · 17 lines
- Unique Binary Search Trees II · 32 lines
- Unique Email Addresses · 12 lines
- Unique Length-3 Palindromic Subsequences · 13 lines
- Unique Morse Code Words · 48 lines
- Unique Number of Occurrences · 21 lines
- Unique Paths · 6 lines
- Unique Paths II · 18 lines
- Unique Paths III · 35 lines
- Unique Substrings in Wraparound String · 23 lines
- Univalued Binary Tree · 25 lines
- UTF-8 Validation · 30 lines
- Valid Anagram · 4 lines
- Valid Arrangement of Pairs · 28 lines
- Validate Binary Search Tree · 24 lines
- Validate Binary Tree Nodes · 48 lines
- Validate IP Address · 32 lines
- Validate Stack Sequences · 11 lines
- Valid Boomerang · 4 lines
- Valid Mountain Array · 11 lines
- Valid Number · 16 lines
- Valid Palindrome · 7 lines
- Valid Palindrome II · 19 lines
- Valid Parentheses · 12 lines
- Valid Parenthesis String · 42 lines
- Valid Perfect Square · 19 lines
- Valid Permutations for DI Sequence · 22 lines
- Valid Square · 18 lines
- Valid Sudoku · 64 lines
- Valid Tic-Tac-Toe State · 30 lines
- Valid Triangle Number · 26 lines
- Verbal Arithmetic Puzzle · 69 lines
- Verifying an Alien Dictionary · 15 lines
- Verify Preorder Serialization of a Binary Tree · 13 lines
- Vertical Order Traversal of a Binary Tree · 32 lines
- Video Stitching · 14 lines
- Vowels of All Substrings · 11 lines
- Vowel Spellchecker · 21 lines
- Walking Robot Simulation · 21 lines
- Walking Robot Simulation II · 38 lines
- Water and Jug Problem · 43 lines
- Water Bottles · 15 lines
- Watering Plants · 16 lines
- Watering Plants II · 18 lines
- Ways to Make a Fair Array · 32 lines
- Ways to Split Array Into Three Subarrays · 15 lines
- Where Will the Ball Fall · 35 lines
- Widest Vertical Area Between Two Points Containing No Points · 12 lines
- Wiggle Sort II · 50 lines
- Wiggle Subsequence · 25 lines
- Wildcard Matching · 23 lines
- Word Break · 25 lines
- Word Break II · 29 lines
- Word Ladder · 26 lines
- Word Ladder II · 106 lines
- Word Pattern · 10 lines
- Word Search · 43 lines
- Word Search II · 50 lines
- Word Subsets · 19 lines
- X of a Kind in a Deck of Cards · 20 lines
- XOR Operation in an Array · 7 lines
- XOR Queries of a Subarray · 31 lines
- Zigzag Conversion · 50 lines
- Zuma Game · 65 lines