Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 502 Bytes

beginner_series_№_2_clock.md

File metadata and controls

28 lines (21 loc) · 502 Bytes

Description

Clock shows h hours, m minutes and s seconds after midnight.

Your task is to write a function which returns the time since midnight in milliseconds.

Example:

h = 0
m = 1
s = 1

result = 61000

Input constraints:

  • 0 <= h <= 23
  • 0 <= m <= 59
  • 0 <= s <= 59

My Solution

def past(h, m, s)
  1000 * (3_600 * h + 60 * m + s)
end