You are viewing a single comment's thread. Return to all comments →
C++ Solution: Need to add width as parameter input.
vector<int> serviceLane(int n, vector<int> width, vector<vector<int>> cases) { int N = cases.size(); vector<int> results; for(int i = 0; i < N; i++) { int min_width = INT8_MAX; for(int j = cases[i][0]; j <= cases[i][1]; j++) { min_width = min(width[j], min_width); } results.push_back(min_width); } return results; }
Seems like cookies are disabled on this browser, please enable them to open this website
Service Lane
You are viewing a single comment's thread. Return to all comments →
C++ Solution: Need to add width as parameter input.