Make Unreal REAL.
article thumbnail
Level 0. 배열 조각하기

 

 

#include <iostream>
#include <vector>

using namespace std;

vector<int> solution(vector<int> arr, vector<int> query)
{
    size_t size = query.size();

    for (int i = 0; i < size; ++i)
        if (i & 1)
            arr.erase(arr.begin(), arr.begin() + query[i]);
        else
            arr.erase(arr.begin() + ++query[i], arr.end());

    return arr;
}
profile

Make Unreal REAL.

@diesuki4

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!

검색 태그