Leetcode-Solutions
Leetcode-Solutions copied to clipboard
The repository for all of the solutions to the Leetcode problems solved on my YouTube, Instagram and TikTok
* moves Pacific Atlantic problem into a directory folder so future algos can live in folders containing solutions as well * includes TS and Go solutions for pacific atlantic problem...
Simplified the solution using top, bottom, left and right pointers
How are you doing Greg, I've identified an issue with the current solution for LeetCode 383: Ransom Note. The existing solution did not accurately reflect the correct space complexity, which...
class Solution: def findClosestNumber(self, nums: List[int]) -> int: min_distance = float("inf") res = None for num in nums: distance = abs(num) if distance < min_distance or (distance == min_distance and...
Easy method to solve and understand the algorithm.
Hello, Greg! The variable 'i' is missing initialization before line 9 in 'Longest Common Prefix - Leetcode 14/Longest Common Prefix - Leetcode 14.py'
Easy method to solve and understand the algorithm
Use if statement instead of while to get back one zero to find the next maximum consecutive subsequence of 1. Please find my explanation. 
Note to @gahogg : Thanks a lot for being an inspiration. Your approach to problems are very unique and you have a clean thought process. We can avoid the internal...