Gary Lai

1137. N-th Tribonacci Number

1137. N-th Tribonacci Number 自頂向下 class Solution: def tribonacci(self,

746. Min Cost Climbing Stairs

746. Min Cost Climbing Stairs 自頂向下 class Solution: def minCostClimbingStairs(

Kth Smallest Element in a Sorted Matrix

378. Kth Smallest Element in a Sorted Matrix 題目的要求是找到在一個排序好的組合矩陣中,找到第

141. Linked List Cycle

141. Linked List Cycle # Definition for singly-linked list. # class ListNode:

1046. Last Stone Weight

1046. Last Stone Weight class Solution: def lastStoneWeight(self, stones:

703. Kth Largest Element in a Stream

703. Kth Largest Element in a Stream class KthLargest: def

215. Kth Largest Element in an Array

215. Kth Largest Element in an Array 如果是要找第 k 個最大/

707. Design Linked List

707. Design Linked List class ListNode: def __init__(self, x)

147. Insertion Sort List

147. Insertion Sort List 通常的排序問題都是問的是陣列的排序,這個題目的要求卻是使用鏈結串列 Linked List 。 題目的解法其實很直覺,從給定的陣列中一每次選擇一個數字,

449. Serialize and Deserialize BST

449. Serialize and Deserialize BST 參考 297. Serialize and Deserialize