일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- LAA
- C++
- 선형대수
- zeros
- EOI
- 프로그래머스
- MATLAB
- omscs
- 개발자
- LV1
- 코딩테스트
- mpnp
- 마니토바
- 방송통신대학교
- 방통대
- 온라인석사
- cpp
- machine learning
- 주정부이민
- Deep learning
- 알고리즘
- Plotting
- 딥러닝
- 매트랩
- 기본
- leetcode
- 컴퓨터과학과
- 조지아텍
- 캐나다 영주권
- 머신러닝
Archives
- Today
- Total
Krononberg
leetcode) 1637. Widest Vertical Area Between Two Points Containing No Points c++ 본문
개발 로그/알고리즘
leetcode) 1637. Widest Vertical Area Between Two Points Containing No Points c++
k._. 2021. 9. 23. 09:50class Solution {
public:
int maxWidthOfVerticalArea(vector<vector<int>>& points) {
vector<int>v;
for(int i=0; i<points.size(); i++){
v.push_back(points[i][0]);
}
sort(v.begin(),v.end());
vector<int>vv;
for(int i =0; i<v.size()-1;i++){
vv.push_back(v[i+1]-v[i]);
}
sort(vv.begin(),vv.end());
return vv[vv.size()-1];
}
};
'개발 로그 > 알고리즘' 카테고리의 다른 글
1290. Convert Binary Number in a Linked List to Integer.cpp (0) | 2021.09.26 |
---|---|
1656. Design an Ordered Stream.cpp (0) | 2021.09.26 |
leetcode) 938. Range Sum of BST c++ (0) | 2021.09.23 |
Leetcode) 1315. Sum of Nodes with Even-Valued Grandparent c++ (0) | 2021.09.21 |
leetcode) 1282. Group the People Given the Group Size They Belong To c++ (0) | 2021.09.21 |