LeetCode

227. Basic Calculator II

227. Basic Calculator II 放進去 stack 的數字,如果都是正、負數的話,就可以直接加總,

315. Count of Smaller Numbers After Self

315. Count of Smaller Numbers After Self class BinaryIndexedTree: def

460. LFU Cache

460. LFU Cache LFU 則是另外一個快取機制,主要是讓越常被存取的資料更快地取出,並包含 LRU 的機制,如果超過限制的資源,

188. Best Time to Buy and Sell Stock IV

188. Best Time to Buy and Sell Stock IV 自頂向下

1136. Parallel Courses

1136. Parallel Courses 這個題目是 207. Course Schedule 和 210. Course

57. Insert Interval

57. Insert Interval 這題的解法很簡單,直接把新的區間加入進去,重新使用 56. 題的解法。 class Solution:

253. Meeting Rooms II

253. Meeting Rooms II 這題我們要算的是,時間有重疊沒有關係,但是告訴我們至少需要幾間會議室,我們才能安排好所有的會議(面試)。 往下閱讀之前,

986. Interval List Intersections

986. Interval List Intersections 這一題應該算是時間區間的最後一個變形,可以想像成,有兩個人的班表,我們要找出他們哪些時間有一起上班,可能是這個時間這兩個人才可以開會,如果說這個題目問超過兩個人,

303. Range Sum Query - Immutable

303. Range Sum Query - Immutable class NumArray: def __init_

67. Add Binary

67. Add Binary class Solution: def addBinary(self, a: str,