討論串[閒聊] 每日leetcode
共 1548 篇文章
內容預覽:
思路:. 找交集的最小值. Python Code:. class Solution:. def getCommon(self, nums1: List[int], nums2: List[int]) -> int:. if set(nums1) & set(nums2):. return min(
(還有33個字)
內容預覽:
水P幣時間. 2540. Minimim Common Value. 兩個排序過的array,找出同時出現的最小值,沒有就回傳-1. 思路:two pointer. int getCommon(int* nums1, int nums1Size, int* nums2, int nums2Size)
(還有184個字)
內容預覽:
開始習慣用Rust的小雞巴東西跟縫合怪了==. Code:. use std::collections::HashMap;. impl Solution {. pub fn max_frequency_elements(nums: Vec<i32>) -> i32 {. let mut counts
(還有257個字)
內容預覽:
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個字)
內容預覽:
今天的寫過了. 隨便撿路上一題來寫. 289. Game of Life. 敘述很長 大概就是看每個elements的neightbor的sum然後做事情. 簡單來說就是個2d convolution. 看解答一堆奇技淫巧. 難怪我當不了designer. int arrsum(int xl, in
(還有951個字)