1344. Angle Between Hands of a Clock Medium

@problem@discussion
#Math



1/**
2 * [1344] Angle Between Hands of a Clock
3 *
4 * Given two numbers, hour and minutes, return the smaller angle (in degrees) formed between the hour and the minute hand.
5 * Answers within 10^-5 of the actual value will be accepted as correct.
6 *  
7 * Example 1:
8 * <img alt="" src="https://assets.leetcode.com/uploads/2019/12/26/sample_1_1673.png" style="width: 300px; height: 296px;" />
9 * Input: hour = 12, minutes = 30
10 * Output: 165
11 * 
12 * Example 2:
13 * <img alt="" src="https://assets.leetcode.com/uploads/2019/12/26/sample_2_1673.png" style="width: 300px; height: 301px;" />
14 * Input: hour = 3, minutes = 30
15 * Output: 75
16 * 
17 * Example 3:
18 * <img alt="" src="https://assets.leetcode.com/uploads/2019/12/26/sample_3_1673.png" style="width: 300px; height: 301px;" />
19 * Input: hour = 3, minutes = 15
20 * Output: 7.5
21 * 
22 *  
23 * Constraints:
24 * 
25 * 	1 <= hour <= 12
26 * 	0 <= minutes <= 59
27 * 
28 */
29pub struct Solution {}
30
31// problem: https://leetcode.com/problems/angle-between-hands-of-a-clock/
32// discuss: https://leetcode.com/problems/angle-between-hands-of-a-clock/discuss/?currentPage=1&orderBy=most_votes&query=
33
34// submission codes start here
35
36impl Solution {
37    pub fn angle_clock(hour: i32, minutes: i32) -> f64 {
38        0f64
39    }
40}
41
42// submission codes end
43
44#[cfg(test)]
45mod tests {
46    use super::*;
47
48    #[test]
49    fn test_1344() {
50    }
51}
52


Back
© 2025 bowen.ge All Rights Reserved.