Gary Lai

2368. Reachable Nodes With Restrictions

2368. Reachable Nodes With Restrictions class Solution: def reachableNodes(self,

695. Max Area of Island

695. Max Area of Island class Solution: def maxAreaOfIsland(self,

103. Binary Tree Zigzag Level Order Traversal

103. Binary Tree Zigzag Level Order Traversal # Definition for a

515. Find Largest Value in Each Tree Row

515. Find Largest Value in Each Tree Row 題目要熟悉 BFS

1026. Maximum Difference Between Node and Ancestor

1026. Maximum Difference Between Node and Ancestor 這題要找的是 「某個節點與它的祖先節點之間的差異最大值」。節點的選擇可以是樹中的任何一點,

1208. Get Equal Substrings Within Budget

1208. Get Equal Substrings Within Budget class Solution: def equalSubstring(

2090. K Radius Subarray Averages

2090. K Radius Subarray Averages 這個題目的重點是細心處理邊界問題。 class Solution: def getAverages(

1413. Minimum Value to Get Positive Step by Step Sum

1413. Minimum Value to Get Positive Step by Step Sum

2270. Number of Ways to Split Array

2270. Number of Ways to Split Array 此道題目需要先理解 Prefix Sum

525. Contiguous Array

525. Contiguous Array 題目給定一個只包含 0 和 1 的陣列,請找出其中最長的子陣列,這個子陣列必須滿足包含相同數量的