Classic

224. Basic Calculator

224. Basic Calculator {% hint style="info" %} 先做 227.

18. 4Sum

18. 4 Sum class Solution: def twoSum(self, nums: List[

2. Add Two Numbers

2. Add Two Numbers 這一題雖然不是加一,不過很類似,所以我放在一起。 # Definition for singly-linked

1485. Clone Binary Tree With Random Pointer

1485. Clone Binary Tree With Random Pointer 概念和 138. Copy

133. Clone Graph

133. Clone Graph 完成這一題之前,應該先熟悉 1490. Clone N-ary Tree 這一題會用到

307. Range Sum Query - Mutable

307. Range Sum Query - Mutable class BIT: def __init_

454. 4 Sum II

454. 4 Sum II 這一個題目的設計比較特別一點,給出四個長度一樣的陣列,要從四個陣列中挑出任意四個數字,其總和為零。 這個題目存在著暴力解,那就是四個陣列一個一個掃描,

653. Two Sum IV - Input is a BST

653. Two Sum IV - Input is a BST 這一個題目的重點在於在遍歷樹的同時,

266. Palindrome Permutation

266. Palindrome Permutation 這一題的題目看起來很恐怖啊,又是回文,又是排列組合的,不過這一個題目其實只考了回文的定義,一個回文是奇數長度還是偶數長度。 1. 如果是奇數長度,

759. Employee Free Time

759. Employee Free Time 這題的題目是標記困難,改變的只有時間區間的表達方式改成了一個物件,而不是陣列,要給的答案是哪些時間是空閒的。 這題寫起來反而是秒殺,首先把所有員工的時間表都拿到,