LeetCode problems and how I solved them.
- Explore - useful technics shortcuts for learn
- Solutions - all solved and refactored problems
- Again - need resolve because of loosing day streak or not enough knowledge
- Archive - all solved problems that in progress refactoring
After adding some code samples run code.sh
./scripts/code.sh
You can automate this action by calling pre-commit.sh
./scripts/test.sh
- The LeetCode Beginner's Guide
- Array and String. Introduction to Data Structure
- Top Interview Questions. Easy Collection
- Longest Palindromic Substring
- String to Integer (atoi)
- Container With Most Water
- Roman to Integer
- Longest Common Prefix
- Valid Parentheses
- Merge Two Sorted Lists
- Swap Nodes in Pairs
- Remove Duplicates from Sorted Array
- Remove Element
- Find the Index of the First Occurrence in a String
- Find First and Last Position of Element in Sorted Array
- Valid Sudoku
- Rotate Image
- Spiral Matrix
- Plus One
- Add Binary
- Simplify Path
- Remove Duplicates from Sorted List II
- Remove Duplicates from Sorted List
- Merge Sorted Array
- Reverse Linked List II
- Validate Binary Search Tree
- Symmetric Tree
- Binary Tree Level Order Traversal
- Binary Tree Zigzag Level Order Traversal
- Maximum Depth of Binary Tree
- Convert Sorted Array to Binary Search Tree
- Minimum Depth of Binary Tree
- Path Sum
- Best Time to Buy and Sell Stock
- Best Time to Buy and Sell Stock II
- Valid Palindrome
- Single Number
- LRU Cache
- Reverse Words in a String
- Min Stack
- Find Peak Element
- Two Sum II - Input Array Is Sorted
- Rotate Array
- Reverse Bits
- Binary Tree Right Side View
- Remove Linked List Elements
- Count Primes
- Contains Duplicate
- Implement Stack using Queues
- Summary Ranges
- Majority Element II
- Lowest Common Ancestor of a Binary Tree
- Sliding Window Maximum
- Closest Binary Search Tree Value
- First Bad Version
- Find the Duplicate Number
- Word Pattern
- Power of Three
- Odd Even Linked List
- Increasing Triplet Subsequence
- Counting Bits
- Flatten Nested List Iterator
- Integer Break
- Reverse Vowels of a String
- Intersection of Two Arrays II
- Guess Number Higher or Lower
- Ransom Note
- Shuffle an Array
- Find the Difference
- Is Subsequence
- Decode String
- Fizz Buzz
- Path Sum III
- Find All Anagrams in a String
- String Compression
- Delete Node in a BST
- Hamming Distance
- Next Greater Element I
- Diagonal Traverse
- Find Largest Value in Each Tree Row
- Minimum Absolute Difference in BST
- Subarray Sum Equals K
- Array Partition
- Permutation in String
- Can Place Flowers
- Dota2 Senate
- Search in a Binary Search Tree
- Insert into a Binary Search Tree
- Design HashMap
- Design Linked List
- Asteroid Collision
- Find Smallest Letter Greater Than Target
- Largest Number At Least Twice of Others
- Jewels and Stones
- Minimum Distance Between BST Nodes
- Bus Routes
- Binary Trees With Factors
- Peak Index in a Mountain Array
- Online Stock Span
- Number of Recent Calls
- Validate Stack Sequences
- Longest Arithmetic Subsequence
- Remove All Adjacent Duplicates In String
- Greatest Common Divisor of Strings
- Find in Mountain Array
- Print in Order
- Largest Unique Number
- Snapshot Array
- Maximum Level Sum of a Binary Tree
- Maximum Number of Balloons
- Count Vowels Permutation
- Check If It Is a Straight Line
- Count Number of Nice Subarrays
- Convert Binary Number in a Linked List to Integer
- Deepest Leaves Sum
- Number of Steps to Reduce a Number to Zero
- Count Negative Numbers in a Sorted Matrix
- Longest ZigZag Path in a Binary Tree
- Find Lucky Integer in an Array
- Build Array Where You Can Find The Maximum Exactly K Comparisons
- Constrained Subsequence Sum
- Counting Elements
- Kids With the Greatest Number of Candies
- Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
- Count Good Nodes in Binary Tree
- Max Dot Product of Two Subsequences
- Longest Subarray of 1's After Deleting One Element
- Can Make Arithmetic Progression From Sequence
- Number of Good Pairs
- Make The String Great
- Richest Customer Wealth
- Max Number of K-Sum Pairs
- Maximum Erasure Value
- Swapping Nodes in a Linked List
- Sum of Unique Elements
- Merge Strings Alternately
- Maximum Score of a Good Subarray
- Check if the Sentence Is Pangram
- Check if All Characters Have Equal Number of Occurrences
- Minimum Number of Operations to Make Array Continuous
- Remove Colored Pieces if Both Neighbors are the Same Color
- Parallel Courses III
- Reverse Nodes in Even Length Groups
- Delete the Middle Node of a Linked List
- Maximum Twin Sum of a Linked List
- Find the Difference of Two Arrays
- Add Two Integers
- Intersection of Multiple Arrays
- Number of Flowers in Full Bloom
- Minimum Consecutive Cards to Pick Up
- Number of Ways to Split Array
- Successful Pairs of Spells and Potions
- Max Sum of a Pair With Equal Sum of Digits
- First Letter to Appear Twice
- Equal Row and Column Pairs
- Removing Stars From a String
- Using a Robot to Print the Lexicographically Smallest String
- Total Cost to Hire K Workers
- Design Graph With Shortest Path Calculator
- Painting the Walls
- Largest Submatrix With Rearrangements
- Number of Ways to Divide a Long Corridor
- Minimum One Bit Operations to Make Integers Zero
- Decode Ways
- String Compression II
- Minimum Difficulty of a Job Schedule
- Maximum Profit in Job Scheduling
- Arithmetic Slices II - Subsequence
- K Inverse Pairs Array
- Number of Submatrices That Sum to Target
- Partition Array for Maximum Sum
- Meeting Rooms III
- Tree Diameter
- Cheapest Flights Within K Stops
- Greatest Common Divisor Traversal
- Find All People With Secret
- Find All Duplicates in an Array
- First Missing Positive