Re: [闲聊] 每日leetcode

楼主: sustainer123 (caster)   2024-03-10 16:57:26
※ 引述《DJYOSHITAKA (franchouchouISBEST)》之铭言:
: 最近好多easy 又水了一天
: 乱写一通
: 349. Intersection of Two Arrays
: Given two integer arrays nums1 and nums2, return an array of their
: intersection. Each element in the result must be unique and you may return
: the result in any order.
: vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
: vector<int> cnt(1001,0);
: unordered_set<int> a;
: unordered_set<int> b;
: vector<int> ans;
: for(auto i : nums1)
: {
: a.insert(i);
: }
: for(auto i : nums2)
: {
: b.insert(i);
: }
: for(auto i : a)
: {
: cnt[i]++;
: }
: for(auto i : b)
: {
: cnt[i]
作者: DJYOSHITAKA (Evans)   2024-03-10 16:58:00
剩我easy写的乱七八糟了
作者: SecondRun (雨夜琴声)   2024-03-10 17:08:00
大师
楼主: sustainer123 (caster)   2024-03-10 17:11:00
我只会刷ez 对不起
作者: NCKUEECS (小惠我婆)   2024-03-10 17:31:00
大师 我写得有够长

Links booklink

Contact Us: admin [ a t ] ucptt.com