2026問AI之Tiobe程式語言排名與Py3, C, C++"你好"實作
herrDeng網內搜尋
自訂搜尋
Ads
2026年9月14日 星期一
2026年6月24日 星期三
Beats 100%|C/C++矩陣冪次方解Leetcode難題3700 Number of ZigZag Arrays II
Beats 100%|C/C++矩陣冪次方解Leetcode難題3700 Number of ZigZag Arrays II
[codes on Leetcode 3700]https://leetcode.com/problems/number-of-zigzag-arrays-ii/solutions/8354788/symmetrymatrix-exponential149ms-beats-10-9hxf/
[codes on Leetcode 3699]https://leetcode.com/problems/number-of-zigzag-arrays-i/solutions/8352758/use-symmetryprefixdpbeats-9352-by-anwend-xcjj/
在這段影片中,我將深入解析如何使用 矩陣快速冪 (Matrix Exponentiation) 來高效解決 LeetCode 難題 3700:Number of ZigZag Arrays II。這題是 ZigZag Array 系列的進階版本,對時間複雜度有極高要求。
2026年6月16日 星期二
C, Py3, C++解Leetcode 3612 與難題3614 Process String with Special Operations
C Py3 C++解Leetcode 3612 與難題3614 Process String with Special Operations
一個字串問題Leetcode 3612,用C++或Python是易如反掌,用C語言就難多了,然而這個解題經驗,順便用來解所謂hard 3614. Process String with Special Operations II
2026年5月6日 星期三
Master LeetCode 1861 | Efficient Loop Strategy for Rotating the Box | Beats 100%
C++ C Py3 loop速解Leetcode 1861 Rotating the Box
一連數日Leetcode都是"rotate"的問題,這些問題都解完了嗎?先解今天的
2026年1月24日 星期六
計數排序與greedy 2 pointer解Leetcode 1877 Minimize Maximum Pair Sum in Array
計數排序與greedy 2 pointer解Leetcode 1877 Minimize Maximum Pair Sum in Array 重點是理解為何Greedy方法可行,code很簡單,就排序sort, counting sort, radix sort都來一遍
[Py3 一行解請進]
2025年12月17日 星期三
C C++ Py3 DP與OOP解Leetcode 3573 Best Time to Buy and Sell Stock V
C C++ Py3 DP與OOP解Leetcode 3573 Best Time to Buy and Sell Stock V
[Py3 code請進]
2025年12月10日 星期三
py3 C C++階乘模運算速解Leetcode 3577 Count the Number of Computer Unlocking Pe...
py3 C C++階乘模運算速解Leetcode 3577 Count the Number of Computer Unlocking Permutations
[1-liner Py3請進]
2025年11月27日 星期四
Py3 C C++ prefix sum解Leetcode 3381 Maximum Subarray Sum With Length Div...
Py3 C C++ prefix sum解Leetcode 3381 Maximum Subarray Sum With Length Divisible by K
Very similar to Kadane's algorithm
[Py3 code請進]
2025年10月30日 星期四
C++ py3 C Rust速解Leetcode 1526 Minimum Number of Increments on Subarrays ...
C++ py3 C Rust adjacent difference與loop速解Leetcode 1526 Minimum Number of Increments on Subarrays to Form a Target Array
[Py3一行解請進]
2025年10月4日 星期六
Py3 C++ C 2pointer速解Leetcode 11Container With Most Water
Py3 C++ C 2pointer速解Leetcode 11Container With Most Water
[Py3 code請進]
2025年9月16日 星期二
C C++ GCD LCM解Leetcode難題2197 Replace Non Coprime Numbers in Array[含Py3 code]
C C++ GCD LCM解Leetcode難題2197 Replace Non Coprime Numbers in Array
用binary Euclidean algorithm定義gcd,然後定義lcm之後就是用stack
[Py3 code請進]
2025年9月6日 星期六
C++C py3 log4 prefix sum, bits解Leetcode難題3495 Minimum Operations to Mak...
C++C py3 log4 prefix sum/bits解Leetcode難題3495 Minimum Operations to Make Array Elements Zero
ceil(log4(x)) 可以透過 clz 計算;將 expSum 定義為部分和來計算。
[Py3 code請進]
2025年9月5日 星期五
C++ C Py3 Rust數bits解Leetcode 2749 Minimum Operations to Make the Intege...
C++ C Py3 Rust數bits解Leetcode 2749 Minimum Operations to Make the Integer Zero
[Py3解請進]
2025年5月17日 星期六
2024年12月5日 星期四
Python C C++ 2 pointer速解Leetcode 2337 Move Pieces to Obtain a String
Python C C++ 2 pointer速解Leetcode 2337 Move Pieces to Obtain a String
多日Leetcode的問題都可用2-pointer法來解,今日2337. Move Pieces to Obtain a String也不例外,這次就用C/C++/Python三個語言來解[Python解請進]
2024年6月2日 星期日
C++ Python C速解Leetcode 344 Reverse String
C++ Python C速解Leetcode 344 Reverse String
交換索引對 (i, n-1-i)。在C的實作中,交換並沒有使用額外的空間,只是透過xor!
2024年4月20日 星期六
C++ DFS BFS貪婪三法解Leetcode農地問題1992 Find All Groups of Farmland
C++ DFS BFS貪婪三法解Leetcode農地問題1992 Find All Groups of Farmland
採用三種方式解題,一是DFS, 二是BFS,前兩法都很標準。農地因為都是矩形,第三法採貪婪演算找出矩形右下角,簡單又快速。
2024年4月5日 星期五
python C++速解Leetcode 1544 make the string great
python C++速解Leetcode 1544 make the string great
基本上算是stack解法,但實作的語言C, C++, python只需要善用個別字串的特性,無須使用stack,大幅加快計算速度,C語言解答請進,並加上最佳C++解
2024年3月8日 星期五
python C C++陣列迴圈速解Leetcode 3005 Count Elements With Maximum Frequency
python C C++陣列迴圈速解Leetcode 3005 Count Elements With Maximum Frequency
陣列迴圈就能解答的,何須用到hash table(C++ unordered_map)簡單的問題可用簡單的 資料結構解答,迴圈就是迴圈、陣列就是陣列(內有python code)
2024年3月3日 星期日
python C C++速解Leetcode 19 Remove Nth Node From End of List並考慮memory leaks問題
python C C++速解Leetcode 19 Remove Nth Node From End of List並考慮memory leaks問題
其實刷題不要只是貪快還是要考慮Memory Leaks,解老題目19 Remove Nth Node From End of List要特別別考慮,另別是C/C++使用者
訂閱:
文章 (Atom)
熱門文章
-
明文=I'm student key=(2,15,8) 密文=?
-
請用C/C++ 程式計算 S=1*1+2*2+3*3+4*4+.....+20*20=?
-
C字串練習 字串 char word[]="You win!"; 輸出為: You win! You win You wi You w You You Yo Y 給進階使用者: gets () 是個危險的函式!
-
array ex 1, 2,3,7,8
-
請問如何用C/C++程式產生下列輸出? 1111111 2222222 3333333 4444444 5555555 6666666 7777777
-
統計第一作業 2, 3, 8, 9
-
列印課表數字代碼矩陣,以及代碼的課名 提示: 參考此連結
