/* 自定義代碼塊樣式 */
Herr Deng桑的教學blog
這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
網頁
首頁
密碼學
程式設計Programming
APP
計算機概論
herrDeng網內搜尋
自訂搜尋
Ads
2025年7月16日 星期三
Py3 C++奇偶交錯奇偶子數列解Leecode 3201 Find the Maximum Length of Valid Subsequ...
Py3 C++奇偶交錯奇偶子數列解Leecode 3201 Find the Maximum Length of Valid Subsequence I
求最長有效子序列,使得 (sub[0] + sub[1]) % 2 == (sub[1] + sub[2]) % 2 == ... == (sub[x - 2] + sub[x - 1]) % 2,有 3 種可能的情況
-全為偶數
-全為奇數
-或奇偶交錯子序列
[Py3解請進]
按我讀文 »
2025年7月15日 星期二
Py3 C++母音 vowel mask速解Leetcode 3136 Valid Word
Py3 C++母音 vowel mask速解Leetcode 3136 Valid Word
Leetcode有許多判斷母音的問題,採用bitmask方式,迅速又方便
-----
Leetcode has many problems in determining vowels. Using the bitmask method is fast and convenient.
[codes onLeetcode]
https://leetcode.com/problems/valid-word/solutions/6959558/bitmask-for-vowel-bitset-beats-100/
較新的文章
較舊的文章
首頁
查看行動版
訂閱:
意見 (Atom)
熱門文章
Java作業6 bmi判斷
Py3 C++ DP動態規劃速解Leetcode 120 Triangle
Py3 C++ DP速解Leetcode 120 Triangle 這題就是用動態規劃解,表列法比較容易 [Py3解請進]
GPG4win使用步驟
打從PGP被某企業買下,使用GPG(Gnu PG)就成了另外一種選擇。包含安裝、金鑰設定、搜尋使用者公鑰憑證、加密、解密等關鍵步驟如下:
「全民資安素養自我評量」
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
Ex8. 費氏數列Visual C#遞迴函式實作 Fibonacci sequence
1. 何謂遞迴函數? 2. 實作費氏數列,用遞迴方法
RSA習題
RSA中, p = 11, q = 13, e = 11 計算n, phi(n), 若明文m = 7, d =11?密文c =?
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萬是可進行記數排序的關鍵,既然可以採用記數排序,後面的二元搜尋也可以透過part...
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 le...
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三角的性質,可得快速解
Py3 C++ C 2pointer速解Leetcode 11Container With Most Water
Py3 C++ C 2pointer速解Leetcode 11Container With Most Water [Py3 code請進]