什麼是ECDSA?
Herr Deng桑的教學blog
這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
herrDeng網內搜尋
自訂搜尋
Ads
3009年5月25日 星期四
2024年4月16日 星期二
C++ DFS BFS解二元樹Leetcode 623 Add One Row to Tree
C++ DFS BFS解二元樹Leetcode 623 Add One Row to Tree
要辨識一位程式設計師是否會使用常用的資料結構,binary tree就是個鑑別率高的東西,許多程式自學者壓根沒見過。Leetcode 623. Add One Row to Tree是個好練習
2024年4月14日 星期日
C++ python速解左葉節點之和Leetcode 404 Sum of Left Leaves
C++ python速解左葉節點之和Leetcode 404 Sum of Left Leaves。影片中採最簡易解法preorder走訪遞迴,並設參數isLeft=0,其他解法詳見Leetcode連結。Python解請進,C++提供一行解。
2024年4月12日 星期五
python c++用monotonic stack解 Leetcode難題42 trapping rain water並附pyplot繪直方圖解說
Python c++用monotonic stack解 Leetcode難題42 trapping rain water並附pyplot繪直方圖解說
想法是使用索引 m 的單調堆疊來找到右牆height[r]和左牆height [l];計算此區域高於底部 height[m]的水量應為min(height[r]-height[m], height[l]-height[m])*(r-l-1)
2024年4月9日 星期二
Python C++速解Leetcode 2073 Time Needed to Buy Tickets
Python CPP速解LLeetcode 2073 Time Needed to Buy Tickets
假設x=tickets[k]。 當i≤k時,person[i]最多只能買x張票; 當 i大於k時,person[i]最多只能購買 x-1 票。python code請進
2024年4月8日 星期一
2024年4月7日 星期日
python C++DP動態規劃解Leetcode 678 Valid Parenthesis String
python C++DP動態規劃解Leetcode 678 Valid Parenthesis String
使用2D DP來求解。 由於 n≤100,因此帶有 memo 的遞迴可以完成這項工作。 知道了遞迴那麼DP就一定可行!
第二種方法是迭代 DP 程式碼; 使用 &1 技巧減少空間至O(n)。Python code請進 。
2024年4月6日 星期六
python C++字串deque解Leetcode 1249 Minimum Remove to Make Valid Parentheses
python C++字串deque解Leetcode 1249 Minimum Remove to Make Valid Parentheses
連續幾天都是含括號的字串問題Leetcode 1249. Minimum Remove to Make Valid Parentheses,都提示用stack其實不用,走訪兩次就好,一次去掉多的 ')' ,第二反向去掉多的 '(' ;選用適當的容器,字串、deque就得解了,最快的C++解請進
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年4月2日 星期二
c++ hashmap與陣列解Leetcode 205 Isomorphic Strings
cpp hashmap與陣列解Leetcode 205 Isomorphic Strings
訂閱:
文章 (Atom)
熱門文章
-
先說明一下這是後知後覺的解答,所謂後知就是股票價格已知存在陣列(清單),當然就要用迴圈練習,雙迴圈暴力解需時O(n**2),當然不用,採python單一迴圈解答「最佳股票的買賣時機#LeetCode 121 Best Time to Buy and Sell Stock」,解...
-
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
-
C 的continue & break [影片]介紹C++程式for迴圈中加上continue與break的差異之簡例 Java迴圈中的的continue & break
-
你會用C的算子sizeof?
-
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
-
RSA 演算 Euler 定理搞定#LeetCode 372 Super Pow--C,C++,Python實作。玩過數論、RSA演算的,解這個問題剛好,C++解答打敗94%,還沒有特別優化。
-
python, CPP Sliding window與組合公式解Leetcode 2962. Count Subarrays Where Max Element Appears at Least K Times