討論串[閒聊] 每日leetcode
共 1548 篇文章
內容預覽:
思路:. 用字典紀錄順序 之後sorted排序. 為了避免key error 所以使用dic.get() 假如x不在dic 回傳27. Python Code:. class Solution:. def customSortString(self, order: str, s: str) -> s
(還有89個字)
內容預覽:
https://leetcode.com/problems/custom-sort-string/description. 791. Custom Sort String. 給你一個字串s和一個表示字元排序優先的字串order,排序字串s,如果字元不在 order的話順序隨意。. 思路:. 1.創建
(還有386個字)
內容預覽:
最近好多easy 又水了一天. 亂寫一通. 349. Intersection of Two Arrays. Given two integer arrays nums1 and nums2, return an array of their. intersection. Each element
(還有579個字)
內容預覽:
感覺沒很難,不過還是寫了很久. 我好爛. https://imgur.com/iIQ9Orr. 146. LRU Cache. 請設計一個Data structure 可以實現Least Recently Used cache. 要包含Constructor、get、put這三個function.
(還有2653個字)