You are viewing a single comment's thread. Return to all comments →
C++ Solution
int hurdleRace(int k, vector height) { auto max_it = max_element(height.begin(), height.end()); return ((*max_it - k) < 0)?0 : *max_it - k; }
Seems like cookies are disabled on this browser, please enable them to open this website
The Hurdle Race
You are viewing a single comment's thread. Return to all comments →
C++ Solution
int hurdleRace(int k, vector height) { auto max_it = max_element(height.begin(), height.end()); return ((*max_it - k) < 0)?0 : *max_it - k; }