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

推噓1(1推 0噓 0→)留言1則,0人參與, 1年前最新作者sustainer123 (caster )時間1年前 (2024/03/09 17:28), 編輯資訊
0
0
0
內容預覽:
思路:. 找交集的最小值. Python Code:. class Solution:. def getCommon(self, nums1: List[int], nums2: List[int]) -> int:. if set(nums1) & set(nums2):. return min(
(還有33個字)

推噓1(1推 0噓 0→)留言1則,0人參與, 1年前最新作者NCKUEECS (小惠我婆)時間1年前 (2024/03/09 11:25), 1年前編輯資訊
0
0
0
內容預覽:
水P幣時間. 2540. Minimim Common Value. 兩個排序過的array,找出同時出現的最小值,沒有就回傳-1. 思路:two pointer. int getCommon(int* nums1, int nums1Size, int* nums2, int nums2Size)
(還有184個字)

推噓2(2推 0噓 3→)留言5則,0人參與, 1年前最新作者yam276 (史萊哲林的優等生)時間1年前 (2024/03/08 18:25), 1年前編輯資訊
0
0
0
內容預覽:
開始習慣用Rust的小雞巴東西跟縫合怪了==. Code:. use std::collections::HashMap;. impl Solution {. pub fn max_frequency_elements(nums: Vec<i32>) -> i32 {. let mut counts
(還有257個字)

推噓1(1推 0噓 4→)留言5則,0人參與, 1年前最新作者sustainer123 (caster )時間1年前 (2024/03/08 10:33), 編輯資訊
0
0
0
內容預覽:
3005. Count Elements With Maximum Frequency. 計算出現最多次的元素之次數之總和. Example 1:. Input: nums = [1,2,2,3,1,4]. Output: 4. Explanation: The elements 1 and 2 h
(還有641個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者DJYOSHITAKA (franchouchouISBEST)時間1年前 (2024/03/07 22:57), 1年前編輯資訊
0
0
0
內容預覽:
今天的寫過了. 隨便撿路上一題來寫. 289. Game of Life. 敘述很長 大概就是看每個elements的neightbor的sum然後做事情. 簡單來說就是個2d convolution. 看解答一堆奇技淫巧. 難怪我當不了designer. int arrsum(int xl, in
(還有951個字)