Find video link at my YouTube channel
Or from the Sheet 1 of this Google Sheet
Languages Used - Java and Python3
# | Title | Solution | Code | Time | Space | Difficulty | Tags | Video |
---|---|---|---|---|---|---|---|---|
0027 | Remove Element | Two pointers for counting valid nos and swapping | Java Python | O(n) | O(1) | Easy | Array Two Pointers | ๐บ |
0053 | Maximum Subarray | Parse array and save the best solution at each step | Java | O(n) | O(1) | Easy | Array Dynamic Programming | |
0055 | Jump Game | Iterate from last index and check if we can reach there from current index or not | Python | O(n) | O(1) | Medium | Array Greedy | ๐บ |
0100 | Same Tree | Check isSame(node.left) and isSame(root.right) | Java | O(n) | O(h) | Easy | Tree Depth-first-Search | ๐บ |
0101 | Symmetric Tree | Check if left.left==right.right and left.right==right.left | Java | O(n) | O(h) | Easy | Tree Depth-first-Search Breadth-first-Search | ๐บ |
0104 | Maximum Depth of Binary Tree | Depth = 1 + Max(depth of left, depth of right) | Java | O(n) | O(h) | Easy | Tree Depth-first-Search | ๐บ |
0121 | Best time to buy and sell stock | Minimize Cost price and Maximise Profit | Java | O(n) | O(1) | Easy | Array Dynamic Programming | ๐บ |
0268 | Missing Number | Assuming that XOR is a constant-time operation, this algorithm does constant work on nn iterations, so the runtime is overall linear | C++ | O(n) | O(1) | Easy | Array Math BitManipulation | |
0283 | Move Zeroes | Two pointers for counting valid nos and swapping | Java | O(n) | O(1) | Easy | Array Two Pointers | ๐บ |
0287 | Find duplicate in array of N+1 numbers | Find the cycle using slow and fast pointer | Java | O(n) | O(1) | Medium | Array Two Pointers | |
0451 | Sort Characters By Frequency | LeetCode Github | Java Python | O(n) | O(n) | Medium | Hash Table Heap | |
0509 | Fibonacci Number | Storing the value of two previous number and updating them | Java | O(n) | O(1) | Easy | Array | ๐บ |
0647 | Palindromic Substrings | Extend from center, 2 function call for odd and even palindromes | Java | O(n^2) | O(1) | Medium | String Dynamic Programming | ๐บ |
0695 | Max Area of Island | Apply DFS on the Gird by exploring every square connected to it 4-directionally, total number of squares explored will be the area of that connected shape. | C++ | O(RโC) | O(RโC) | Medium | Depth-First-Search | |
1347 | Minimum Number of Steps to Make Two Strings Anagram | Add 1 for char in s and remove 1 for char in t | Java | O(n+m) | O(1) | Medium | Hash Table Heap | ๐บ |
1352 | Product of the Last K Numbers | Add new element to list by multiplying it with previous number and return arr[n-1]/arr[n-k-1] | Python | O(1) | O(1) | Medium | Array Design | ๐บ |
Format
0000 | Ques name | Algo | Java | O() | O() | Easy | Category | ๐บ |
---|---|---|---|---|---|---|---|---|
0000 | Ques name | Algo | Java | O() | O() | Easy | Category | ๐บ |