LeetCode 🟢 3931. Check Adjacent Digit Differences
依題意線性掃描相鄰字元對,將數字轉為整數後檢查每一對相鄰數字差的絕對值是否皆不超過 2。
LeetCode 🟢 1351. Count Negative Numbers in a Sorted Matrix
利用矩陣各橫列(row)與直行(column)非遞增的單調性,以二分搜尋或左下角階梯走法統計負數總數。
LeetCode 🟢 4120. Count Dominant Elements
枚舉每個元素,內部元素以 2 * nums[i] >= 左右鄰居之和避免除法,端點只與單一鄰居比較,並特判 n = 1。
最新文章
標籤
AlgoPythonCodeforcesAtCoderAtCoder Beginner ContestABC模擬(Simulation)狀態壓縮計數(Counter)前綴和(Prefix Sum)貢獻法縮點有序容器(Sorted Container)C++模運算(Modular Arithmetic)雜湊表(Hash Table)回溯(Backtracking)DFSBFS樹狀陣列(Binary Indexed Tree)逆序對(Inverse Pair)樹(Tree)計數(Counting)分組循環迭代(Iteration)遞迴(Recursion)字串(String)併查集(Disjoint Set Union)博弈論(Game Theory)動態規劃(Dynamic Programming)
網站資訊
文章數量 :
472
總字數 :
678k
最後更新時間 :





