|
1 | 1 | # nodejs-algorithms
|
2 | 2 |
|
| 3 | +| № | Problem Title | LeetCode | Solution | Ideal O(Time) | Ideal O(Space) |
| 4 | +|----|----------------------------------------------------------------------|------------------------------------------------------------------- |-------------------- |-------------- |----------------- |
| 5 | +| 1 | Two Sum | [Link](https://leetcode.com/problems/two-sum) |[Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/array/two-sum.ts) | $O(n)$ | $O(n)$ |
| 6 | +| 2 | Longest Substring Without Repeating Characters | [Link](https://leetcode.com/problems/longest-substring-without-repeating-characters) |[Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/string/longest-substring.string.ts) | $O(n)$ | $O(min(m,n))$ |
| 7 | +| 3 | Valid Parentheses | [Link](https://leetcode.com/problems/valid-parentheses) | [Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/stack/valid-parentheses.ts) | $O(n)$ | $O(n)$ |
| 8 | +| 4 | Merge Two Sorted Lists | [Link](https://leetcode.com/problems/merge-two-sorted-lists) | [Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/linked-list/merge-two-sorted-lists.ts) | $O(n+m)$ | $O(1)$ |
| 9 | +| 5 | Best Time to Buy and Sell Stock | [Link](https://leetcode.com/problems/best-time-to-buy-and-sell-stock) | [Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/array/best-time-to-buy-and-sell.ts) | $O(n)$ | $O(1)$ |
| 10 | +| 6 | Maximum Subarray | [Link](https://leetcode.com/problems/maximum-subarray) | [Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/array/maximum-subarray.ts) | $O(n)$ | $O(1)$ |
| 11 | +| 7 | Linked List Cycle | [Link](https://leetcode.com/problems/linked-list-cycle) | [Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/linked-list/linked-list-cycle.ts) | $O(n)$ | $O(1)$ |
| 12 | +| 8 | Climbing Stairs | [Link](https://leetcode.com/problems/climbing-stairs) | [Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/dynamic-programming/climbing-stairs.ts)| $O(n)$ | $O(1)$ |
| 13 | +| 9 | Binary Search | [Link](https://leetcode.com/problems/binary-search) | [Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/searching/binary-search.ts) | $O(log n)$ | $O(1)$ |
| 14 | +| 10 | Invert Binary Tree | [Link](https://leetcode.com/problems/invert-binary-tree) | [Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/tree/invert-binary-tree.ts) | $O(n)$ | $O(n)$ |
| 15 | +| 11 | Symmetric Tree | [Link](https://leetcode.com/problems/symmetric-tree) | [Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/tree/symmetric-tree.ts) | $O(n)$ | $O(n)$ |
| 16 | +| 12 | Maximum Depth of Binary Tree | [Link](https://leetcode.com/problems/maximum-depth-of-binary-tree) | [Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/tree/maximum-depth-of-binary-tree.ts) | $O(n)$ | $O(n)$ |
| 17 | +| 13 | Contains Duplicate | [Link](https://leetcode.com/problems/contains-duplicate) | [Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/array/contains-duplicate.ts) | $O(n)$ | $O(n)$ |
| 18 | +| 14 | Product of Array Except Self | [Link](https://leetcode.com/problems/product-of-array-except-self) | [Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/array/product-of-array-except-self.ts)| $O(n)$ | $O(1)$ |
| 19 | +| 15 | Merge Intervals | [Link](https://leetcode.com/problems/merge-intervals) | [Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/intervals/merge-intervals.ts) | $O(n \log n)$ | $O(n)$ |
| 20 | +| 16 | Unique Paths | [Link](https://leetcode.com/problems/unique-paths) | [Link](https://github.com/shkvik/nodejs-algorithms/blob/main/src/dynamic-programming/unique-paths.ts) | $O(m \times n)$| $O(m \times n)$ |
0 commit comments