Sort by

recency

|

1418 Discussions

|

  • + 0 comments

    Kotlin solution:

    val tallestHeight = height.maxOrNull() ?: 0 val result = tallestHeight - k

    if (result < 0){
        return 0
    } else {
        return result
    }
    
  • + 0 comments

    C# return height.Max()-k > 0 ? height.Max()-k : 0;

  • + 0 comments

    TS Solution:

    function hurdleRace(k: number, height: number[]): number {
        // Write your code here
        return Math.max(Math.max(...height) - k, 0)
    }
    
  • + 0 comments

    The hurdle race is always such a thrilling event to watch! The way the athletes glide over each obstacle is amazing—true skill and precision at every jump. Speaking of precision, it reminds me of getting my car serviced at Mercedes Service—they handle everything with such care and expertise, just like those athletes clearing every hurdle flawlessly!

  • + 0 comments

    Here is my c++ solution, you can watch the explanation here : https://youtu.be/HTbex2B-Yas

    int hurdleRace(int k, vector<int> height) {
        int mx = *max_element(height.begin(), height.end());
        return max(0, mx-k);
    }