A Second Opinion
Last updated
Last updated
To break this problem into several small problems:
Find the hours
Find the minutes
Find the seconds
For hours, we just need to use integer division /
, hours = input secs / 3600
. After we get the hours, substract it from our input secs
.
Do the similar operation on minutes
. The remaining are seconds
.