Gary Lai

298. Binary Tree Longest Consecutive Sequence

298. Binary Tree Longest Consecutive Sequence 參考:257. Binary Tree

129. Sum Root to Leaf Numbers

129. Sum Root to Leaf Numbers 請參考 257. Binary Tree

257. Binary Tree Paths

257. Binary Tree Paths 題目給定一個二元樹,要找出從跟節點到最終的葉節點的所有路徑。 既然這個題目要求要找出所有可能的路徑,那就一定是需要窮舉的題目,既然需要窮舉,就可以用

Meta - Kaitenzushi

from typing import List # Write any import statements here import

Meta - Cafeteria

題目問的是餐廳有 N 個位置,但是我們需要保持 k 個單位的社交距離,座位上目前會有 M 個人在位置上,其座位表由

21. Merge Two Sorted Lists

21. Merge Two Sorted Lists # Definition for singly-linked list. # class

702. Search in a Sorted Array of Unknown Size

702. Search in a Sorted Array of Unknown Size 這個題目的主要考察點是要如何先確定邊界,

658. Find K Closest Elements

658. Find K Closest Elements 這個題目是給定一個點 x,要找出最接近的 k 個點,

206. Reverse Linked List

206. Reverse Linked List 在當前的節點中,我們要把原先指向下一個節點的方向,轉變為指向上一個節點(已經反轉完成的節點),接著處理下一個節點。 1.

199. Binary Tree Right Side View

199. Binary Tree Right Side View 這一題和 116. Populating Next