Re: [閒聊] 每日LeetCode
※ 引述《Neuenmuller (蘇菲・諾伊恩謬拉)》之銘言:
: ※ 引述《Rushia (みけねこ的鼻屎)》之銘言:
: : https://leetcode.com/problems/restore-the-array-from-adjacent-pairs/description
: : 1743. Restore the Array From Adjacent Pairs
: 另外用一個unordered_set來存所有走過的數字,多花了一坨空間
看了之後突然想到
直接用Set紀錄Ans就好了吧
最後再把Set轉成Array輸出
這樣就不用紀錄lastValue
不過不知道這兩種方法哪種效能好一點
而且不知道Set裡面會不會照著輸入順序排
沒試過
--
Zoosewu
Yoututbe顯示PTT推文
可以在各個網站追實況或Live時使用
預覽圖: https://i.imgur.com/ZhtXdAJ.png
完整介紹: https://github.com/zoosewu/PTTChatOnYoutube/tree/master/homepage
支援的網站: Youtube Twitch Holotools Niji-mado Holodex
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.32.229.33 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1699661517.A.955.html
推
11/11 08:16,
6月前
, 1F
11/11 08:16, 1F
→
11/11 08:36,
6月前
, 2F
11/11 08:36, 2F
討論串 (同標題文章)