package leetcode;

import java.util.Arrays;

/**
 * https://leetcode.com/problems/incremental-memory-leak/
 */
public class Problem1860 {
    public int[] memLeak(int memory1, int memory2) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1860 prob = new Problem1860();
        System.out.println(Arrays.toString(prob.memLeak(2, 2))); // [3,1,0]
        System.out.println(Arrays.toString(prob.memLeak(8, 11))); // [6,0,4]
    }
}

@@ -16,34 +16,8 @@
 e;%0A%0A
-import java.util.Arrays;%0A%0A
 /**%0A
@@ -170,85 +170,139 @@
     
-// TODO%0A        return null
+int%5B%5D answer = new int%5B3%5D;%0A        int i = 1
 ;%0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args
+int m1 = memory1;%0A        int m2 = memory2;%0A        while (m1 %3E= 0 && m2 %3E= 0
 ) %7B%0A
@@ -313,198 +313,371 @@
     
+   
-Problem1860 prob = new Problem1860();%0A        System.out.println(Arrays.toString(prob.memLeak(2, 2))); // %5B3,1,0%5D%0A        System.out.println(Arrays.toString(prob.memLeak(8, 11))); // %5B6,0,4%5D
+ if (m1 == m2 %7C%7C m1 %3E m2) %7B%0A                m1 -= i;%0A            %7D else %7B // m1 %3C m2%0A                m2 -= i;%0A            %7D%0A            if (m1 %3C 0 %7C%7C m2 %3C 0) %7B%0A                answer%5B0%5D = i;%0A                break;%0A            %7D%0A            answer%5B0%5D = i;%0A            answer%5B1%5D = m1;%0A            answer%5B2%5D = m2;%0A            i++;%0A        %7D%0A        return answer;
 %0A   

Solve problem 1860