Looking to ace your coding interviews and land your dream job? Look no further than this comprehensive study plan for practicing with LeetCode! Our GitHub repository is packed with resources to help you master the algorithms and data structures commonly found in coding interviews. With easy-to-follow guides and practice problems, you'll be able to sharpen your skills and build your confidence in no time. Whether you're a beginner or an experienced coder, this study plan is perfect for anyone looking to improve their interview performance. So why wait? Start practicing today and get one step closer to your dream job!
- Time Complexity: O(n)
- Space Complexity: O(1)
class Solution:
def runningSum(self, nums: List[int]) -> List[int]:
prefix = 0
for i in range(len(nums)):
prefix += nums[i]
nums[i] = prefix
return nums
- Time Complexity: O(n)
- Space Complexity: O(1)
class Solution:
def pivotIndex(self, nums: List[int]) -> int:
leftSum = 0
totalSum = sum(nums)
for i in range(len(nums)):
if totalSum - nums[i] == leftSum:
return i
else:
totalSum -= nums[i]
leftSum += nums[i]
return -1
- Time Complexity: O(n)
- Space Complexity: O(n)
class Solution:
def isIsomorphic(self, s: str, t: str) -> bool:
keys = list({a:b for a,b in zip(s,t)}.keys())
values = list({a:b for a,b in zip(t,s)}.values())
return keys == values
- Time Complexity: O(n)
- Space Complexity: O(1)
class Solution:
def isSubsequence(self, s: str, t: str) -> bool:
if len(s) > len(t):
return False
if not s:
return True
s_ptr = 0
for char in t:
if s_ptr <= len(s)-1:
if s[s_ptr] == char:
s_ptr += 1
return len(s) == s_ptr
- Merge Two Sorted Lists (easy)
- Reverse Linked List (easy)
- Middle of the Linked List (easy)
- Linked List Cycle II (medium)
- Best Time to Buy and Sell Stock (easy)
- Longest Palindrome (easy)
- N-ary Tree Preorder Traversal (easy)
- Binary Tree Level Order Traversal (medium)
- Binary Search (easy)
- First Bad Version (easy)
- Validate Binary Search Tree (medium)
- Lowest Common Ancestor of a Binary Search Tree (medium)
- Flood Fill (medium)
- Number of Islands (medium)
- Fibonacci Number (easy)
- Climbing Stairs (easy)
- Min Cost Climbing Stairs (easy)
- Unique Paths (medium)
- Find All Anagrams in a String (medium)
- Longest Repeating Character Replacement (medium)
- Two Sum (easy)
- Bulls and Cows (medium)
- Backspace String Compare (easy)
- Decode String (medium)
- Last Stone Weight (easy)
- Top K Frequent Words (medium)