Mid/SeniorMath
Angle Between Hands of a Clock
Given two numbers, hour and minutes, return the smaller angle, in degrees, formed between the hour hand and the minute hand.
Answers within 10^-5 of the actual value will be accepted as correct.
Example 1
Input
hour = 12, minutes = 30Output
165At 12:30, the smaller angle between the hour hand and minute hand is 165 degrees.
Example 2
Input
hour = 3, minutes = 30Output
75At 3:30, the smaller angle between the hour hand and minute hand is 75 degrees.
Constraints
- 1 <= hour <= 12
- 0 <= minutes <= 59