1. stack으로 넣음 2. 다시 꺼내면서 #인지 공백인지에 따라 string input에 넣고 input을 다음 원소로 넘어가기전에 answer 배열에 push_back해줌 -오래걸린 부분 while문에 원소가 0인 경우 예외처리를 안해줌 -푸는 데 걸린 시간: 1시간 18분 #include #include #include using namespace std; vector solution(int n, vector arr1, vector arr2) { stack binary_x, binary_y; vector answer; for (int i = 0; i < n; i++) { int x = arr1[i]; int y = arr2[i]; //* 배열 1에 대해 이진화 while (x !
= 1 && x!=0) { binary_x.push(x % 2); x /= 2; } if(x!
=...
#
인지
원문 링크 : kakao - 비밀지도