코드카타-체육복


#include <bits/stdc++.h>
using namespace std;
int solution(int n, vector<int> lost, vector<int> reserve) {
sort(lost.begin(), lost.end());
sort(reserve.begin(), reserve.end());
vector<int> L, R;
{
int i = 0, j = 0;
while (i < (int)lost.size() && j < (int)reserve.size()) {
if (lost[i] == reserve[j]) {
i++; j++;
} else if (lost[i] < reserve[j]) {
L.push_back(lost[i]);
i++;
} else {
R.push_back(reserve[j]);
j++;
}
}
while (i < (int)lost.size()) L.push_back(lost[i++]);
while (j < (int)reserve.size()) R.push_back(reserve[j++]);
}
int answer = n - (int)L.size();
for (int x : L) {
auto it = find(R.begin(), R.end(), x - 1);
if (it != R.end()) {
R.erase(it);
answer++;
continue;
}
it = find(R.begin(), R.end(), x + 1);
if (it != R.end()) {
R.erase(it);
answer++;
continue;
}
}
return answer;
}
숫자 야구 과제 진행도
어제 크래시가 나서 오늘 봤더니
위젯블루프린트가 플레이어 컨트롤러에 등록되지 않았다.
그래서 코드를 살펴보았는데 그건 거의 제대로 한 거였다.
그래서 강의를 다시 듣고서 코드를 보강하고 나서도 안 되길래
마지막으로 위젯을 살펴보았다.
강의에 써 있는대로 패널과 텍스트 버튼의 이름을 바꿔보았다.
그러더니 갓챠 >ㅅ</
마침내 되었어요!!!!
'TIL' 카테고리의 다른 글
| 3/12일자 TIL (0) | 2026.03.12 |
|---|---|
| 3/11일자 TIL (0) | 2026.03.11 |
| 3/09일자 TIL (0) | 2026.03.09 |
| 3/06일자 TIL (0) | 2026.03.06 |
| 3/05일자 TIL 및 KPT회고 (0) | 2026.03.05 |