Skip to content

Commit 03f1a5d

Browse files
committedFeb 12, 2020
2020-02-11
1 parent c17a760 commit 03f1a5d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution(object):
2+
def angleClock(self, hour, minutes):
3+
"""
4+
:type hour: int
5+
:type minutes: int
6+
:rtype: float
7+
"""
8+
min_angle = minutes * 1.0 / 60 * 360
9+
hour_angle = hour * 1.0 / 12 * 360 + minutes * 1.0 / 60 * 30
10+
11+
res = abs(hour_angle - min_angle)
12+
13+
return res if res < 180 else 360 - res

0 commit comments

Comments
 (0)
Please sign in to comment.