HardRelated Topics: Graph / Heap (Priority Queue) / Shortest PathLeetCode Sourc...
這題是 977. Squares of a Sorted Array 目的是將已排序的陣列每個元素平方後,按非遞減順序排序回傳。
題目:給定一個已按照非遞減順序...
題目:
給定一個非空字串 s 和一個字典 wordDict,判斷 s 是否可以由字典中的單詞串接而成。字典中的單詞可以重複使用,且字典中的單詞是無序的。
範例:...
559. Maximum Depth of N-ary Tree
tags: Easy、Tree
Given a n-ary tree, find its m...
961. N-Repeated Element in Size 2N Array
tags: Easy、Sizeof
You are given an int...
動態規劃(Dynamic Programming) 動態規劃是一種有效率計算由子問題堆疊而成的演算法,是一種常見的解題方式。透過將問題分解成許多可以利用簡單方法...