2021年3月24日星期三

I have been solving problems in HackerRank and I am getting " Runtime Error :( " again and again, for all problems. What mistake am I doing here...?

#!/bin/python3    import math  import os  import random  import re  import sys    # Complete the breakingRecords function below.  def breakingRecords(scores):            first_best_record = scores[0]      first_worst_record = scores[0]            best_record = 0      worst_record = 0            for score in scores:          if score > first_best_record:              first_best_record = score              best_record += 1          elif score < first_worst_record:              first_worst_record = score              worst_record += 1                    print(best_record, worst_record)              if __name__ == '__main__':      fptr = open(os.environ['OUTPUT_PATH'], 'w')        n = int(input())        scores = list(map(int, input().rstrip().split()))        result = breakingRecords(scores)        fptr.write(' '.join(map(str, result)))      fptr.write('\n')        fptr.close()  

There we go... Runtime Error!

No response in my output

https://stackoverflow.com/questions/66793207/i-have-been-solving-problems-in-hackerrank-and-i-am-getting-runtime-error March 25, 2021 at 12:41PM

没有评论:

发表评论