#1344

Angle Between Hands of a Clock

specialist · 660 · lc medium +30 · verified · 64.4% accepted · 1,373 likes · top 68%

Description

Given the integers hour and minutes, return the smaller of the two angles (in degrees) formed between the hour and minute hands of a clock. Answers within 10-5 of the correct value are accepted.

Example 1:

Input: hour = 12, minutes = 30
Output: 165

Example 2:

Input: hour = 3, minutes = 30
Output: 75

Example 3:

Input: hour = 3, minutes = 15
Output: 7.5

Code

1
2
3