Class Solution
java.lang.Object
g1301_1400.s1344_angle_between_hands_of_a_clock.Solution
1344 - Angle Between Hands of a Clock.<p>Medium</p>
<p>Given two numbers, <code>hour</code> and <code>minutes</code>, return <em>the smaller angle (in degrees) formed between the</em> <code>hour</code> <em>and the</em> <code>minute</code> <em>hand</em>.</p>
<p>Answers within <code>10<sup>-5</sup></code> of the actual value will be accepted as correct.</p>
<p><strong>Example 1:</strong></p>
<p><img src="https://assets.leetcode.com/uploads/2019/12/26/sample_1_1673.png" alt="" /></p>
<p><strong>Input:</strong> hour = 12, minutes = 30</p>
<p><strong>Output:</strong> 165</p>
<p><strong>Example 2:</strong></p>
<p><img src="https://assets.leetcode.com/uploads/2019/12/26/sample_2_1673.png" alt="" /></p>
<p><strong>Input:</strong> hour = 3, minutes = 30</p>
<p><strong>Output:</strong> 75</p>
<p><strong>Example 3:</strong></p>
<p><img src="https://assets.leetcode.com/uploads/2019/12/26/sample_3_1673.png" alt="" /></p>
<p><strong>Input:</strong> hour = 3, minutes = 15</p>
<p><strong>Output:</strong> 7.5</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= hour <= 12</code></li>
<li><code>0 <= minutes <= 59</code></li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
angleClock
public double angleClock(int hour, int minutes)
-