Herr Deng桑的教學blog
這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
網頁
(移至...)
首頁
密碼學
程式設計Programming
APP
計算機概論
▼
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月14日 星期日
C++ Trie prefix tree解母音拼字Leetcode 966 Vowel Spellchecker
C++ Trie prefix tree解母音拼字Leetcode 966 Vowel Spellchecker
如果unordered_set, unordered_map有其他替方案就用,能用Trie去解也算是一種成就
--------
If there are alternatives to unordered_set and unordered_map, use them. Being able to solve them with Trie is also an achievement.
[codes on Leetcode]
https://leetcode.com/problems/vowel-spellchecker/solutions/7187402/vowel-bitmask-trie-vs-hash-tables-15ms-beats-100/
‹
›
首頁
查看網路版