We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
public static int hurdleRace(int k, List height) {
int dens = 0;
for( Integer x : height){
if(x>k && Math.abs(k-x) > dens){
dens = Math.abs(k-x);
}
}
return dens;
}
Cookie support is required to access HackerRank
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 →
public static int hurdleRace(int k, List height) { int dens = 0; for( Integer x : height){ if(x>k && Math.abs(k-x) > dens){ dens = Math.abs(k-x); } } return dens; }