SOLUTION INFO
C++ · main.cpp
class Solution {
public:
vector<int> pivotArray(vector<int>& nums, int pivot) {
vector<int> L, M, R;
for(const int &x: nums) {
if(x < pivot) L.push_back(x);
else if(x == pivot) M.push_back(x);
else R.push_back(x);
}
for(const int &x: M) L.push_back(x);
for(const int &x: R) L.push_back(x);
return L;
}
};
SOLUTION DESCRIPTION
풀이 설명
등록된 풀이 설명이 없습니다.
DISCUSSION
댓글
GitHub 로그인 후 작성할 수 있으며 모든 댓글은 이 저장소의 Discussions에 보관됩니다.