Notion Database - all of my notes on the problems
I prefer to initially code using Google Docs as my primary platform, unless it's a new topic that necessitates debugging in a terminal or if I encounter challenges that prevent me from completing the task within the allotted time. (30m)
- 1. Two Sum
- 2. Add Two Numbers
- 3. Longest Substring Without Repeating Characters
- 4. Median of Two Sorted Arrays
- 5. Longest Palindromic Substring
- 7. Generate Parentheses
- 9. Palindrome Number
- 11. Container With Most Water
- 15. 3Sum
- 19. Remove Nth Node From End of List
- 20. Valid Parentheses
- 21. Merge Two Sorted Lists
- 22. Generate Parentheses
- 23. Merge k Sorted Lists
- 33. Search in Rotated Sorted Array
- 48. Rotate Image
- 49. Group Anagrams
- 53. Maximum Subarray
- 54. Spiral Matrix
- 56. Merge Intervals
- 57. Insert Interval
- 73. Set Matrix Zeroes
- 76. Minimum Window Substring
- 79. Word Search
- 83. Remove Duplicates from Sorted List
- 98. Validate Binary Search Tree
- 100. Same Tree
- 102. Binary Tree Level Order Traversal
- 104. Maximum Depth of Binary Tree
- 105. Construct Binary Tree from Preorder and Inorder Traversal
- 121. Best Time to Buy and Sell Stock
- 128. Longest Consecutive Sequence
- 133. Clone Graph
- 135. Candy
- 124. Binary Tree Maximum Path Sum
- 125. Valid Palindrome
- 141. Linked List Cycle
- 143. Reorder List
- 151. Reverse Words in a String
- 152. Maximum Product Subarray
- 153. Find Minimum in Rotated Sorted Array
- 190. Reverse Bits
- 191. Number of 1 Bits
- 198. House Robber
- 200. Number of Islands
- 206. Reverse Linked List
- 207. Course Schedule
- 208. Implement Trie (Prefix Tree)
- 211. Design Add and Search Words Data Structure
- 212. Word Search II
- 213. House Robber II
- 217. Contains Duplicate
- 226. Invert Binary Tree
- 230. Kth Smallest Element in a BST
- 235. Lowest Common Ancestor of a Binary Search Tree
- 238. Product of Array Except Self
- 242. Valid Anagram
- 268. Missing Number
- 271. Encode and Decode Strings (Premium)
- 283. Move Zeroes
- 295. Find Median from Data Stream
- 297. Serialize and Deserialize Binary Tree
- 345. Reverse Vowels of a String
- 371. Sum of Two Integers
- 374. Top K Frequent Elements
- 334. Increasing Triplet Subsequence
- 338. Counting Bits
- 383. Ransom Note
- 392. Is Subsequence
- 394. Decode String
- 412. Fizz Buzz
- 417. Pacific Atlantic Water Flow
- 424. Longest Repeating Character Replacement
- 435. Non-overlapping Intervals
- 443. String Compression
- 530. Minimum Absolute Difference in BST
- 572. Subtree of Another Tree
- 605. Can Place Flowers
- 643. Maximum Average Subarray I
- 647. Palindromic Substrings
- 714. Best Time to Buy and Sell Stock with Transaction Fee
- 724. Find Pivot Index
- 735. Asteroid Collision
- 743. Network Delay Time
- 771. Jewels and Stones
- 832. Flipping an Image
- 876. Middle of the Linked List
- 997. Find the Town Judge
- 1004. Max Consecutive Ones III
- 1027. Longest Arithmetic Subsequence
- 1071. Greatest Common Divisor of Strings
- 1161. Maximum Level Sum of a Binary Tree
- 1187. Make Array Strictly Increasing
- 1207. Unique Number of Occurrences
- 1342. Number of Steps to Reduce a Number to Zero
- 1365. How Many Numbers Are Smaller Than the Current Number
- 1431. Kids With the Greatest Number of Candies
- 1456. Maximum Number of Vowels in a Substring of Given Length
- 1480. Running Sum of 1d Array
- 1493. Longest Subarray of 1's After Deleting One Element
- 1512. Number of Good Pairs
- 1569. Number of Ways to Reorder Array to Get Same BST
- 1572. Matrix Diagonal Sum
- 1657. Determine if Two Strings Are Close
- 1672. Richest Customer Wealth
- 1679. Max Number of K-Sum Pairs
- 1732. Find the Highest Altitude
- 1768. Merge Strings Alternately
- 1791. Find Center of Star Graph
- 1909. Remove One Element to Make the Array Strictly Increasing
- 1971. Find if Path Exists in Graph
- 2090. K Radius Subarray Averages
- 2215. Find the Difference of Two Arrays
- 2352. Equal Row and Column Pairs
- 2373. Largest Local Values in a Matrix
- 2390. Removing Stars From a String
- 2448. Minimum Cost to Make Array Equal
solution.js - The solution I submitted
my_solution.js - My attemp with logs and comments
o_solution.js - Online/others' solutions
To run the Elixir solution:
iex ./.../solution.ex
Batch create:
chapter=1572 && mkdir ./$chapter && touch ./$chapter/my_solution.ex && touch ./$chapter/solution.ex && alias x="iex ./$chapter/my_solution.ex"
then you can use
x
for quick debug.
To run the JS solution:
node ./.../solution.js
Batch create:
chapter=947 && mkdir ./$chapter && touch ./$chapter/my_solution.js && touch ./$chapter/solution.js && alias x="node ./$chapter/my_solution.js"
then you can use
x
for quick debug.
Author: Jing Hui PANG - LinkedIn | Email | GitHub | LeetCode | WakaTime