討論串[閒聊] 每日leetcode
共 316 篇文章

推噓2(2推 0噓 2→)留言4則,0人參與, 2月前最新作者sustainer123 (caster )時間2月前 (2024/03/10 16:57), 編輯資訊
0
0
0
內容預覽:
思路:取交集. Python Code:. class Solution:. def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:. return set(nums1) & set(nums2). 又是ez

推噓1(1推 0噓 0→)留言1則,0人參與, 2月前最新作者Rushia (みけねこ的鼻屎)時間2月前 (2024/03/11 09:41), 編輯資訊
2
1
1
內容預覽:
https://leetcode.com/problems/custom-sort-string/description. 791. Custom Sort String. 給你一個字串s和一個表示字元排序優先的字串order,排序字串s,如果字元不在 order的話順序隨意。. 思路:. 1.創建
(還有386個字)

推噓3(3推 0噓 1→)留言4則,0人參與, 2月前最新作者sustainer123 (caster )時間2月前 (2024/03/11 10:45), 編輯資訊
1
0
1
內容預覽:
思路:. 用字典紀錄順序 之後sorted排序. 為了避免key error 所以使用dic.get() 假如x不在dic 回傳27. Python Code:. class Solution:. def customSortString(self, order: str, s: str) -> s
(還有89個字)

推噓1(1推 0噓 1→)留言2則,0人參與, 2月前最新作者NCKUEECS (小惠我婆)時間2月前 (2024/03/11 11:56), 編輯資訊
0
0
1
內容預覽:
大師寫得好精簡我不獻醜了. 我用c寫 跑老半天都沒過. 最後發現忘記加'\0'. 我好爛:(. 恨c. --. 發信站: 批踢踢實業坊(ptt.cc), 來自: 218.164.231.134 (臺灣). 文章網址: https://www.ptt.cc/bbs/Marginalman/M.

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者UsadaBeguora (兔田背鍋拉)時間2月前 (2024/03/11 19:37), 編輯資訊
0
0
0
內容預覽:
寫到一半發現處長站在我後面看. 下午在產線躲了半天. 我要怎麼無聲無息地回去拿包包下班. 除了金蟬脫殼. 姆咪. --. 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.34.86.192 (臺灣). 文章網址: https://www.ptt.cc/bbs/Marginalman/M