LeetCode

1335. Minimum Difficulty of a Job Schedule

1335. Minimum Difficulty of a Job Schedule 這個題目其實寫的滿不清楚的,面試如果遇到這個題目其實也考察如何向面試官搞清楚題目的流程的。 這個題目是給定一個陣列,

1770. Maximum Score from Performing Multiplication Operations

1770. Maximum Score from Performing Multiplication Operations Top-Down class Solution:

740. Delete and Earn

740. Delete and Earn 這個題目從題目本身的敘述其實滿容易猜到解法是透過動態規劃求解,比較困難的是要找到符合動態規劃的子問題。 題目給的條件是如果選定一個數字 k,其中如果有 n

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 需要透過 heap 來實作