You are viewing a single comment's thread. Return to all comments →
C++
int chiefHopper(vector<int> h) { int n = h.size(); int end = 0; int tem = 0; for (int i = n - 1; i >= 0; i--) { tem = end + h[i]; if (tem % 2 == 0) end = tem / 2; else end = tem / 2 + 1; } return end; }
Seems like cookies are disabled on this browser, please enable them to open this website
Chief Hopper
You are viewing a single comment's thread. Return to all comments →
C++