Back to General discussions forum
I think I have a solution to take a total number of seconds and convert them back to the proper form (D H M S) It passes the three test cases and about half of the formal answers. The other answers are exactly 30 minutes off. I can't tell if they're ahead or behind.
Has there been an issue with this checker or do I need to revisit my math? (Not looking for answers just guidance.) Thanks!
#applicable code Python 2
trip = end - begin
ans_days = trip // 84600
trip -= ans_days * 84600
ans_seconds = trip % 60
ans_minutes = trip // 60 % 60
ans_hours = trip // 60 // 60
You've got a typo in line 3 and 4. (I hope that's suitably vague.)
So simple. Thank you for the second set of eyes.