How to Subtract from Time in Golang
The challenge
Clock shows h
hours, m
minutes and s
seconds after midnight.
Your task is to write a function that returns the time since midnight in milliseconds.
Example:
Input constraints:
0 <= h <= 23
0 <= m <= 59
0 <= s <= 59
The solution in Golang
Option 1:
Option 2:
Option 3:
Test cases to validate our solution
|
|