CarlosLabs
[Hackerrank Challenges - The hurdle race ] (https://www.hackerrank.com/challenges/the-hurdle-race/problem)
#!/bin/python3 import math import os import random import re import sys # Complete the hurdleRace function below. def hurdleRace(k, height): minDose = [] for n in range(0,len(height)): if (height[n]) > k: ##print((height[n])-k) minDose.append((height[n])-k) else: minDose.append(0) return max(minDose) if __name__ == '__main__': fptr = open(os.environ['OUTPUT_PATH'], 'w') nk = input().split() n = int(nk[0]) k = int(nk[1]) height = list(map(int, input().rstrip().split())) result = hurdleRace(k, height) fptr.write(str(result) + '\n') fptr.close()