Seconds to Clock
Convert a number of seconds into the text "H:MM:SS": hours with no leading zero (and no limit, 100 hours is "100"), then minutes and seconds as two digits each.
Example 1
seconds 3661
returns "1:01:01"
1 hour, 1 minute, 1 second: "1:01:01".
Constraints
0 <= seconds <= 10**6
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More Math problems
- Staircase of StonesBeginner
- Steps to Reduce to ZeroBeginner
- Sum of Consecutive PowersBeginner
- Sum of DivisorsBeginner
- Sum of MultiplesBeginner
- Type of TriangleBeginner
- Add Minutes to a ClockEasy
- Add StringsEasy