Path Sum 這是一題經典的二元樹問題,測試我們對樹的遍歷與遞迴的理解。
題目:
給定一個二元樹的根節點 root 和一個整數目標值 targetSum,判...
HardRelated Topics: Hash Table / String / Greedy / Sorting / CountingLeetCode S...
題目:
給定一個二元樹,回傳其每一層的平均值。
範例:範例 1:
輸入:
3
/ \
9 20
/...
題目:在這篇文章中,我們將探討 LeetCode 383:Ransom Note,並解釋如何有效地解決這個問題。題目要求我們判斷,給定的 ransomNote...
MediumRelated Topics: Math / String / SimulationLeetCode Source
解題想法
首先我們要定義分子...
題目: 1894. Find the Student that Will Replace the Chalk題意:給定一個整數陣列chalk,以及一個整數k現場...