討論串[閒聊] 每日LeetCode
共 719 篇文章
內容預覽:
好久沒寫leetcode了,決定回來寫. 之前遇到學校作業太多,就會不想寫leetcode,希望之後能堅持住. 寫個C++的,記憶體在90%以上,但速度是10%以下QQ. class Solution {. public:. vector<int> topKFrequent(vector<int>&
(還有621個字)
內容預覽:
https://leetcode.com/problems/top-k-frequent-elements/description/. 347. Top K Frequent Elements. 給你一個陣列 nums,找出出現次數最多次的前k個元素是哪些。. Example 1:. Input:
(還有774個字)
內容預覽:
https://leetcode.com/problems/shortest-bridge/description/. 934. Shortest Bridge. 給你一二維陣列表示的矩陣,0表示海,1表示陸地,相連的陸地是一個島嶼,這個矩陣. 恰好存在兩個島嶼,如果想要在兩個島建立一個橋使其兩島嶼
(還有2268個字)
內容預覽:
https://leetcode.com/problems/is-graph-bipartite/description/. 785. Is Graph Bipartite?. 給你一個無向圖,判斷他是否是二分圖。. Example 1:. https://assets.leetcode.com/u
(還有1331個字)
內容預覽:
https://leetcode.com/problems/minimum-number-of-vertices-to-reach-all-nodes/description/. 1557. Minimum Number of Vertices to Reach All Nodes. 找出最小的集合
(還有1976個字)