diff --git a/medium/angle_between_hands_of_a_clock.py b/medium/angle_between_hands_of_a_clock.py new file mode 100644 index 0000000..0e39f17 --- /dev/null +++ b/medium/angle_between_hands_of_a_clock.py @@ -0,0 +1,8 @@ +# https://leetcode.com/problems/angle-between-hands-of-a-clock + +class Solution: + def angleClock(self, hour: int, minutes: int) -> float: + minute = 360 / 60 * minutes + hour = hour % 12 + hour = 360 / 12 * hour + 360 / 12 / 60 * minutes + return min(abs(hour - minute), 360 - abs(hour - minute)) \ No newline at end of file