Herr Deng桑的教學blog
這是Herr Deng桑的教學blog,主要處理作業與班導事務,另外還有數位小品。
網頁
(移至...)
首頁
密碼學
程式設計Programming
APP
計算機概論
▼
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
[code on Leetcode]
https://leetcode.com/problems/isomorphic-strings/solutions/4960172/use-array-as-map-bitset-vs-hash-map-0ms-beats-100/
[Leetcode程式]
https://www.youtube.com/watch?v=XpO9wcI8KAg&list=PLYRlUBnWnd5IdDHk2BjqXwesydU17z_xk
‹
›
首頁
查看網路版