leetcode My (and copypasted) solutions for leetcode problems. List of problems solved:
- Remove Nth node from end of list
- Merge two sorted lists
- Add binary
- Add strings
- Add two numbers
- Generate parenthesis
- Merge K sorted lists
- Implement strStr()
- Search in Rotated Sorted Array
- Valid Sudoku
- First Missing Positive
- Trapping Rain Water
- Wildcard Matching
- Rotate Image
- Permutations
- Group Anagrams
- Pow(x, n)
- Maximum Subarray
- Spiral Matrix
- Jump Game
- Merge Intervals
- Unique Paths
- Sqrt(x)
- Climb Stairs
- Set Matrix Zeroes
- Sort Colors
- Subsets
- Binary Tree Inorder Traversal
- Delete Node in a Linked List
- Maximum depth of binary tree
- Kth Smallest Element in a BST
- Reverse linked list
- Pascal's Triangle
- Convert Sorted Array to Binary Search Tree
- Fizz Buzz
- Longest Palindrome
- Number of 1 bits
- Majority Element
- Valid Anagram
- Missing number
- Excel Sheet Column Number
- Move Zeroes
- Merge Sorted Array
- Symmetric Tree
- Best Time To Buy And Sell Stock
- Linked List Cycle
- Contains Duplicate
- Intersection Of Two Linked Lists
- Intersection Of Two Arrays
- Happy Number
- Reverse Bits
- Palindrome Linked List
- Power Of Three
- Game Of Life
- Kth Largest Element in an Array
- Top K Frequent Elements
- Binary Tree Level Order Traversal
- Palindrome Partitioning
- Kth Smallest Element in a Sorted Matrix
- Count And Say
- Word Search
- Decode Ways
- Binary Tree Zigzag Level Order Traversal
- Construct Binary Tree from Preorder and Inorder Traversal
- Populating Next Right Pointers in Each Node
- Longest Consecutive Sequence
- Surrounded Regions
- Copy List With Random Pointer
- Word Break
- Sort List
- Determine if String Halves Are Alike
- Minimum Window Substring
- Determine if Two Strings Are Close
- Sort Characters By Frequency
- Minimum Average Difference
- Middle of the Linked List
- Odd Even Linked List
- Range Sum of BST
- Leaf-Similar Trees
- Maximum Difference Between Node and Ancestor
- Binary Tree Maximum Path Sum
- Maximum Product of Splitted Binary Tree
- Evaluate Reverse Polish Notation
- Minimum Falling Path Sum
- House Robber
- Longest Common Subsequence
- Maximum Product Subarray
- Find Center Of Star Graph
- Search Insert Position
- Swap Nodes in Pairs
- Find Peak Element
- Find if Path Exists in Graph
- Keys and Rooms
- Possible Bipartition
- Sum of Distances in Tree
- Invert Binary Tree
- Best Time to Buy and Sell Stock with Cooldown
- Domino and Tromino Tiling
- Diameter of Binary Tree
- Longest Subsequence With Limited Sum
- Next Permutation
- Maximum Bags With Full Capacity of Rocks
- Remove Stones to Minimize the Total
- Single-Threaded CPU
- All Paths From Source to Target
- Combination Sum
- Jump Game II
- Detect Capital
- Delete Columns to Make Sorted
- Minimum Path Sum
- Minimum Number of Arrows to Burst Balloons
- Maximum Ice Cream Bars
- Search a 2D Matrix
- Flatten Binary Tree to Linked List
- Same Tree
- Build Array from Permutation
- Number of Good Pairs
- Palindrome Number
- Lexicographically Smallest Equivalent String
- First Letter to Appear Twice
- Insert Interval
- Flip String to Monotone Increasing
- Maximum Sum Circular Subarray
- Subarray Sums Divisible by K
- Non-decreasing Subsequences
- Restore IP Addresses
- Combination Sum II
- Find the Town Judge
- Snakes and Ladders
- Find Closest Node to Given Two Nodes
- Cheapest Flights Within K Stops
- Concatenated Words
- Remove Element
- Length of Last Word
- Remove Duplicates from Sorted List
- Balanced Binary Tree
- Minimum Depth of Binary Tree
- Path Sum
- Binary Tree Postorder Traversal
- Pascal's Triangle II
- Find All Anagrams in a String
- Shuffle the Array
- Fruit Into Baskets
- Excel Sheet Column Title
- Naming a Company
- As Far from Land as Possible
- Remove Linked List Elements
- Minimum Fuel Cost to Report to the Capital
- Count Odd Numbers in an Interval Range
- Isomorphic Strings
- Add to Array-Form of Integer
- Contains Duplicate II
- Minimum Distance Between BST Nodes
- Summary Ranges
- Power of Two
- Binary Tree Paths
- Single Element in a Sorted Array
- Capacity To Ship Packages Within D Days
- Add Digits
- Ugly Number
- Word Pattern
- Nim Game
- Integer to Roman
- Find Duplicate Subtrees
- Sort an Array
- String Compression
- 3Sum Closest
- 4Sum
- Counting Bits
- Kth Missing Positive Number
- Multiply Strings
- Koko Eating Bananas
- Linked List Cycle II
- Permutations II
- Convert Sorted List to Binary Search Tree
- Rotate List
- Unique Paths II
- Sum Root to Leaf Numbers
- Check Completeness of a Binary Tree
- Construct Binary Tree from Inorder and Postorder Traversal
- Combinations
- Remove Duplicates from Sorted Array II
- Search in Rotated Sorted Array II
- Can Place Flowers
- Number of Zero-Filled Subarrays
- Minimum Score of a Path Between Two Cities
- Number of Operations to Make Network Connected
- Reorder Routes to Make All Paths Lead to the City Zero
- Count Unreachable Pairs of Nodes in an Undirected Graph
- Longest Cycle in a Graph
- Intersection of Two Arrays
- Minimum Cost For Tickets
- Reducing Dishes
- Scramble String
- Number of Ways of Cutting a Pizza
- Binary Search
- Successful Pairs of Spells and Potions
- Boats to Save People
- Optimal Partition of String
- Minimize Maximum of Array
- Number of Closed Islands
- Number of Enclaves
- Guess Number Higher or Lower
- Left and Right Sum Differences
- Removing Stars From a String
- Simplify Path
- Validate Stack Sequences
- Longest Palindromic Subsequence
- Maximum Value of K Coins From Piles
- Number of Ways to Form a Target String Given a Dictionary
- Kids With the Greatest Number of Candies
- Merge Strings Alternately
- Longest ZigZag Path in a Binary Tree
- Maximum Width of Binary Tree
- Richest Customer Wealth
- Minimum Time Visiting All Points
- Hamming Distance
- Last Stone Weight
- Max Consecutive Ones
- Find All Numbers Disappeared in an Array
- Sort the People
- Concatenation of Array
- Check if Number Has Equal Digit Count and Digit Value
- Replace Elements with Greatest Element on Right Side
- Average Salary Excluding the Minimum and Maximum Salary
- Sign of the Product of an Array
- Find the Difference of Two Arrays
- Truncate Sentence
- Maximum Number of Vowels in a Substring of Given Length
- Number of Subsequences That Satisfy the Given Sum Condition
- Count Items Matching a Rule
- Matrix Diagonal Sum
- Minimum Operations to Make the Array Increasing
- Spiral Matrix II
- Uncrossed Lines
- Replace All Digits with Characters
- Count Ways To Build Good Strings
- Count Number of Pairs With Absolute Difference K
- Swapping Nodes in a Linked List
- Sorting the Sentence
- Maximum Twin Sum of a Linked List
- Minimum Number of Vertices to Reach All Nodes
- Is Graph Bipartite?
- Evaluate Division
- Shortest Bridge
- Kth Largest Element in a Stream
- Maximum Subsequence Score
- Maximum Product of Two Elements in an Array
- Stone Game II
- Goal Parser Interpretation
- Check if the Sentence Is Pangram
- Maximum Nesting Depth of the Parentheses
- Running Sum of 1d Array
- Sum of All Odd Length Subarrays
- Shuffle String
- Check If Two String Arrays are Equivalent
- Count the Number of Consistent Strings
- Number of Provinces
- Check If It Is a Straight Line
- Can Make Arithmetic Progression From Sequence
- Minimum Flips to Make a OR b Equal to c
- Count Negative Numbers in a Sorted Matrix
- Find Smallest Letter Greater Than Target
- Sum of Unique Elements
- Maximum Product Difference Between Two Pairs
- Number of Strings That Appear as Substrings in Word
- Maximum Ascending Subarray Sum
- Minimum Absolute Difference in BST
- Final Prices With a Special Discount in a Shop
- Check if All Characters Have Equal Number of Occurrences
- Fibonacci Number
- Find the Highest Altitude
- Decrypt String from Alphabet to Integer Mapping
- N-Repeated Element in Size 2N Array
- Squares of a Sorted Array
- Sum of Root To Leaf Binary Numbers
- Height Checker
- Find Common Characters
- Regions Cut By Slashes
- Binary Tree Level Order Traversal II
- Deepest Leaves Sum
- Unique Number of Occurrences
- Find Numbers with Even Number of Digits
- Fair Distribution of Cookies
- Univalued Binary Tree
- Split a String in Balanced Strings
- Single Number II
- Remove All Adjacent Duplicates In String
- Number of Steps to Reduce a Number to Zero
- How Many Numbers Are Smaller Than the Current Number
- Maximum 69 Number
- Minimum Value to Get Positive Step by Step Sum
- Average of Levels in Binary Tree
- Sort Array by Increasing Frequency
- Final Value of Variable After Performing Operations
- Water Bottles
- Special Array With X Elements Greater Than or Equal X
- Counting Words With a Given Prefix
- Next Greater Element I
- Add Two Numbers II
- Valid Perfect Square
- Find the Difference
- Longest Palindrome
- Number of Longest Increasing Subsequence
- Assign Cookies
- All Possible Full Binary Trees
- Sum of Left Leaves
- Island Perimeter
- Number Complement
- Find Mode in Binary Search Tree
- Relative Ranks
- Sort Array By Parity
- Reverse Words in a String III
- Array Partition
- Minimum Index Sum of Two Lists
- N-ary Tree Preorder Traversal
- N-ary Tree Postorder Traversal
- Two Sum IV - Input is a BST
- Rotate String
- Sort Array By Parity II
- Reverse Only Letters
- Monotonic Array
- Fair Candy Swap
- Uncommon Words from Two Sentences
- Lemonade Change
- Check if There is a Valid Partition For The Array
- Merge Two Binary Trees
- Longest Harmonious Subsequence
- Repeated Substring Pattern
- Maximum Product of Three Numbers
- Self Dividing Numbers
- Ransom Note
- Long Pressed Name
- Increasing Order Search Tree
- Transpose Matrix