討論串[閒聊] 每日leetcode
共 1548 篇文章
內容預覽:
來個py無腦寫法 完全不想思考 感覺要一輩子當自宅守備員了. class Solution:. def compareVersion(self, version1: str, version2: str) -> int:. ver1 = version1.split('.'). ver2 = ver
(還有161個字)
內容預覽:
https://leetcode.com/problems/compare-version-numbers/description. 165. Compare Version Numbers. 給你兩個表示版本的字串,求出哪個版本比較大. If version1 < version2, return
(還有892個字)
內容預覽:
婷婷:可不可以用unordered map. 其實用set也可以捏. 反正只是記錄而已. 捏. ```cpp. class Solution {. public:. int findMaxK(vector<int>& nums). {. int res = -1;. int len = nums.s
(還有126個字)
內容預覽:
https://reurl.cc/lQeDQj. 2441. Largest Positive Integer That Exists With Its Negative. 給定一不包含0的數列,尋找最大正整數,此正整數k的-k需存在於nums. 回傳正整數k 如果無符合條件的正整數 回傳-1. E
(還有887個字)
內容預覽:
https://leetcode.com/problems/reverse-prefix-of-word. 2000. Reverse Prefix of Word. 給定一string與一character 找到該character 假定該character的index為i. 翻轉word[0]到
(還有1294個字)