作者ZooseWu (動物園 公告)
看板Marginalman
標題Re: [閒聊] 每日LeetCode
時間Sat Nov 11 08:11:55 2023
※ 引述《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://i.imgur.com/WqbLNV3.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
推 Neuenmuller: 不會照順序排 11/11 08:16
→ ZooseWu: 那就沒辦法了 11/11 08:36