package leetcode;

/**
 * https://leetcode.com/problems/water-and-jug-problem/
 */
public class Problem365 {
    public boolean canMeasureWater(int x, int y, int z) {
        // TODO
        return false;
    }

    public static void main(String[] args) {
        Problem365 prob = new Problem365();
        System.out.println(prob.canMeasureWater(3, 5, 4)); // true
        System.out.println(prob.canMeasureWater(2, 6, 5)); // false
    }
}

@@ -175,12 +175,208 @@
  // 
-TODO
+http://www.math.tamu.edu/~dallen/hollywood/diehard/diehard.htm%0A        if (z == 0) %7B%0A            return true;%0A        %7D%0A        if ((x + y) %3E= z && gcd(x, y) == 1) %7B%0A            return true;%0A        %7D
 %0A   
@@ -410,21 +410,22 @@
    p
-ublic
+rivate
  static 
 void
@@ -424,213 +424,115 @@
 tic 
-void main(String%5B%5D args) %7B%0A        Problem365 prob = new Problem365();%0A        System.out.println(prob.canMeasureWater(3, 5, 4)); // true%0A        System.out.println(prob.canMeasureWater(2, 6, 5)); // false
+int gcd(int a, int b) %7B%0A        if (b == 0) %7B%0A            return a;%0A        %7D%0A        return gcd(b, a %25 b);
 %0A   

Solve problem 365