주소 * & 헷갈리지 말기
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> solution(vector<int> array, vector<vector<int>> commands) {
vector<int> answer;
for(auto ele : commands){
int i = ele[0]-1;
int j = ele[1];
int k = ele[2]-1;
vector<int> arr;
auto init = array.begin()+i;
for(init;init<array.begin()+j;init++){
arr.push_back(*init);
}
sort(arr.begin(), arr.end());
answer.push_back(arr[k]);
}
return answer;
}