일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- 방송통신대학교
- MATLAB
- 조지아텍
- leetcode
- 컴퓨터과학과
- cpp
- 딥러닝
- omscs
- 방통대
- mpnp
- C++
- 위니펙
- 온라인석사
- 프로그래머스
- EOI
- 개발자
- 주정부이민
- 선형대수
- Plotting
- LAA
- 매트랩
- 알고리즘
- LV1
- 코딩테스트
- 머신러닝
- zeros
- 캐나다 영주권
- 기본
- Deep learning
- machine learning
Archives
- Today
- Total
Byte by Byte
1656. Design an Ordered Stream.cpp 본문
class OrderedStream {
public:
vector<string>os;
int x;
int idx =0;
OrderedStream(int n) {
vector<string> temp(n);
os = temp;
x = n;
}
vector<string> insert(int idKey, string value) {
vector<string>res;
os[idKey-1] = value;
for(; idx<x;idx++){
if(os[idx].empty()) break;
res.push_back(os[idx]);
}
return res;
}
};
/**
* Your OrderedStream object will be instantiated and called as such:
* OrderedStream* obj = new OrderedStream(n);
* vector<string> param_1 = obj->insert(idKey,value);
*/
'개발 로그 > 알고리즘' 카테고리의 다른 글
1551. Minimum Operations to Make Array Equal.cpp (0) | 2021.09.27 |
---|---|
1290. Convert Binary Number in a Linked List to Integer.cpp (0) | 2021.09.26 |
leetcode) 1637. Widest Vertical Area Between Two Points Containing No Points c++ (0) | 2021.09.23 |
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 |