We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#!/bin/python3importmathimportosimportrandomimportreimportsysfromdatetimeimportdatetimeasdt# Complete the time_delta function below.deftime_delta(t1,t2):fmt='%a%d%b%Y%H:%M:%S%z'return(int(abs((dt.strptime(t1,fmt)-dt.strptime(t2,fmt)).total_seconds())))if__name__=='__main__':fptr=open(os.environ['OUTPUT_PATH'],'w')t=int(input())fort_itrinrange(t):t1=input()t2=input()delta=time_delta(t1,t2)fptr.write(str(delta)+'\n')fptr.close()
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Time Delta
You are viewing a single comment's thread. Return to all comments →