Gary Lai
  • Home
  • About
登入 訂閱
Classic

1650. Lowest Common Ancestor of a Binary Tree III

Gary Lai

Jan 30, 2023

1650. Lowest Common Ancestor of a Binary Tree III

Check 235. Lowest Common Ancestor of a Binary Search Tree

閱讀下一篇

209. Minimum Size Subarray Sum

209. Minimum Size Subarray Sum class Solution: def minSubArrayLen(self, target: int, nums: List[int]) -> int: slow = 0 fast = 0 total = 0 res = float('inf') while fast < len(nums): total += nums[fast] while total >= target: res = min(res, fast - slow + 1) total -= nums[slow] slow += 1 fast
Gary Lai Jun 6, 2023

561. Array Partition

561. Array Partition class Solution: def arrayPairSum(self, nums: List[int]) -> int: nums.sort() res = 0 i = 0 while i < len(nums): res += nums[i] i += 2 return res
Gary Lai Jun 6, 2023

210. Course Schedule II

210. Course Schedule II Check 207. Course Schedule
Gary Lai Jan 30, 2023

訂閱Gary Lai

Don't miss out on the latest news. Sign up now to get access to the library of members-only articles.
  • Sign up
Gary Lai © 2023. Powered by Ghost