일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- 개발자
- leetcode
- Plotting
- mpnp
- 머신러닝
- machine learning
- 기본
- 매트랩
- 방통대
- 온라인석사
- cpp
- zeros
- C++
- 방송통신대학교
- 컴퓨터과학과
- 코딩테스트
- 주정부이민
- 프로그래머스
- MATLAB
- 위니펙
- 선형대수
- 조지아텍
- LV1
- 딥러닝
- LAA
- omscs
- 알고리즘
- 캐나다 영주권
- EOI
- Deep learning
Archives
- Today
- Total
Byte by Byte
442. Find All Duplicates in an Array.cpp 본문
class Solution {
public:
vector<int> findDuplicates(vector<int>& nums) {
vector<int>res;
map<int,int>m;
for(int i =0; i<nums.size(); i++){
if(++m[nums[i]] == 2) res.push_back(nums[i]);
}
return res;
}
};
'개발 로그 > 알고리즘' 카테고리의 다른 글
python - string Module ) from collections import Counter (0) | 2022.05.11 |
---|---|
1854. Maximum Population Year.cpp (0) | 2021.12.17 |
49. Group Anagrams.cpp (0) | 2021.12.16 |
1078. Occurrences After Bigram.cpp (0) | 2021.12.15 |
1598. Crawler Log Folder.cpp (0) | 2021.12.15 |