package leetcode;

/**
 * https://leetcode.com/problems/angle-between-hands-of-a-clock/
 */
public class Problem1344 {
    public double angleClock(int hour, int minutes) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1344 prob = new Problem1344();
        System.out.println(prob.angleClock(12, 30)); // 165
        System.out.println(prob.angleClock(3, 30)); // 75
        System.out.println(prob.angleClock(4, 50)); // 155
        System.out.println(prob.angleClock(12, 0)); // 0
    }
}

@@ -181,362 +181,461 @@
  // 
-TODO%0A        return 
+Every hour is 0.5 degrees.%0A        double hDeg = (360 / 12) / 60.
 0;%0A    
-%7D%0A%0A
     
-public static void
+// Every
  m
-a
 in
-(String%5B%5D args) %7B%0A        Problem1344 prob = new Problem1344();%0A        System.out.println(prob.angleClock(12, 30)); // 165%0A        System.out.println(prob.angleClock(3, 30)); // 75%0A        System.out.println(prob.angleClock(4, 50)); // 155%0A        System.out.println(prob.angleClock(12, 0)); // 0
+ute is 6 degrees.%0A        double mDeg = 360 / 60.0;%0A        double h = hour == 12 ? 0 : hour * 5;%0A        double degree = (Math.abs(h - minutes) * mDeg);%0A        if (h %3C minutes) %7B%0A            degree -= minutes * hDeg;%0A        %7D else %7B%0A            degree += minutes * hDeg;%0A        %7D%0A        degree = Math.abs(degree);%0A        return Math.min(360 - degree, degree);
 %0A   

Solve problem 1344