Angle Calculation Between Clock Hands
Given a specific time in hours and minutes, your task is to calculate the smallest possible angle between the hour hand and the minute hand of a clock.
Example:
Input:
T = 2
H = 3, M = 30
H = 9, M = 45
Output:
75
112
Explanation:
In the first example, when the time is 3:30, the smaller angle between the hour and minute hands is 75 degrees.
Constraints:
1 ≤ T ≤ 50
1 ≤ H ≤ 12
0 ≤ M ≤ 59
- Time limit: 1 second
Note:
There are two potential angles between the clock hands, but you must return the minimum of these two angles. When computing the angle, return its floor value, e.g., for an angle of 15.2, you should return 15.
Ensure your implemented function outputs the results as expected.
Calculate the smallest angle between the hour and minute hands of a clock for a given time.
Calculate the angles formed by the hour and minute hands separately
Find the absolute difference between the t...read more
Top UBS ENO interview questions & answers
Top HR questions asked in UBS ENO
Reviews
Interviews
Salaries
Users/Month