637. Average of Levels in Binary Tree 這道題比較簡單,只需要對 tree 進行 level traversal 的同時,計算每層的 av...
637. Average of Levels in Binary Tree 這道題比較簡單,只需要對 tree 進行 level traversal 的同時,計算每層的 av...
這次完全忘記參加了。 643. Maximum Average Subarray I 比較容易,直接計算 length 為 k 的 subarray 的平均值,掃一遍整個 a...
1. 前綴,后綴和中綴之間相互轉(zhuǎn)換 中綴表示轉(zhuǎn)前綴/后綴(附代碼)針對負數(shù)的情況前綴/中綴/后綴相互轉(zhuǎn)換 2. Tree Traversal wikisuccessor, p...
645. Set Mismatch 這道題只需確保 i 位置上的數(shù)滿足 nums[i]==i+1,通過不斷換位置即可。 time complexity: O(n), spac...