Algorithm 24 - Beginner Series #2 Clock

Beast from the east·2021년 10월 6일
0

Algorithm

목록 보기
24/27

Q.

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

A)

int past(int h, int m, int s) 
{
  int result;
  return result = h * 3600000 + m * 60000 + s * 1000;
}
profile
Hello, Rabbit

0개의 댓글