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
풀이 설명
등록된 풀이 설명이 없습니다.