Accepted solution

The Hurdle Race(Hacker Rank)

Open original problem
Source code

int hurdleRace(int k, vector<int> height)

 {

    int max=-999999;

    for(int i=0; i<height.size();i++)

    {

        if(max<height[i])

        {

            max=height[i];

        }

    }

   

    if(max>k)

    {

        return max-k;

    }

    else

     return 0;

 

}
Join the discussion

Add your comment