I have been working on a Coursera assignment, it required my run time to be less than 5.00 . The code is below, but my question is basically about the first and last line, where I was testing the processing time
import time
def pairwise_product(number):
n = len(number)
product = 0
for i in range(n):
for j in range(i+1, n):
product = max(product, number[i] * number[j])
return product
input_length = int(input())
input_number = [int(x) for x in input().split()]
print(pairwise_product(input_number))
print(time.perf_counter())
Using the last line of code, my processing time was 3.3251947
However, when I submitted this code onto Coursera, I have failed my assignment because according to the system, my processing time was 9.99
I am very confused, because since the runtime on my computer is inconsistent with the runtime on Coursera, it means I am no longer able to debug and test my program before submitting it. Is it to do with my programme?
Thank you a lot!