/* 自定義代碼塊樣式 */

herrDeng網內搜尋

自訂搜尋

Ads

2025年11月8日 星期六

Py3 C++導出遞迴公式解難題Leetcode1611 Minimum One Bit Operations to Make Integer...


Py3 C++導出遞迴公式解難題Leetcode1611  Minimum One Bit Operations to Make Integers Zero從導出公式到寫出code,一次完成解Leetcode難題
[C++一行解請進]

2025年10月30日 星期四

2025年10月21日 星期二

py3 C++ Line sweep解Leetcode 3346 Maximum Frequency of an Element After ...


py3 cpp Line sweep解Leetcode 3346  Maximum Frequency of an Element After Performing Operations I
使用 line sweep不用排序,可得線性解
[Py3解請進]

2025年10月13日 星期一

Py3 C++計數bitmask與2 pointers速解Leetcode2273 Find Resultant Array After Re...


Py3 C++計數bitmask與2 pointers速解Leetcode2273  Find Resultant Array After Removing Anagrams
字串長度最長也只有10,四個bits一組,用bitmask解題
-----
The maximum length of a string is only 10, and four bits are grouped together. Use bitmask to solve the problem.
[Py3 code請進]

2025年10月8日 星期三

C++ Py3 計數排序與partial sum解Leetcode 2300 Successful Pairs of Spells and ...







C++ Py3  計數排序與partial sum解Leetcode 2300  Successful Pairs of Spells and Potions
Portions的極大值小於等於10萬是可進行記數排序的關鍵,既然可以採用記數排序,後面的二元搜尋也可以透過partial sum的手法加速。
[Py3 code請進]

2025年9月30日 星期二

C++ Pascal三角與模10算術解Leetcode 2221 Find Triangular Sum of an Array(含Py3 Code)


C++ Pascal三角與模10算術解Leetcode 2221  Find Triangular Sum of an Array
如果採用有支援非常長int的程式語言,mod 10算術就整個省略,就用Pascal三角的性質,可得快速解
Related Posts Plugin for WordPress, Blogger...

熱門文章