LeetCode

787. Cheapest Flights Within K Stops

787. Cheapest Flights Within K Stops 這一題的考點 1. 在 BFS

399. Evaluate Division

399. Evaluate Division class Solution: def calcEquation(self, equations: List[

1202. Smallest String With Swaps

1202. Smallest String With Swaps 這個題目難在要怎麼想到使用 Graph 的實作來做。 題目給定的 pairs

1101. The Earliest Moment When Everyone Become Friends

1101. The Earliest Moment When Everyone Become Friends 這個題目是我認為很好的一道面試題,因為題目的情景很貼近日常生活,

797. All Paths From Source to Target

797. All Paths From Source to Target class Solution: def

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(self,