package leetcode;

import java.util.List;

/**
 * https://leetcode.com/problems/find-positive-integer-solution-for-a-given-equation/
 */
public class Problem1237 {
    interface CustomFunction {
        // Returns f(x, y) for any given positive integers x and y.
        // Note that f(x, y) is increasing with respect to both x and y.
        // i.e. f(x, y) < f(x + 1, y), f(x, y) < f(x, y + 1)
        int f(int x, int y);
    }

    public List<List<Integer>> findSolution(CustomFunction customfunction, int z) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
    }
}

@@ -12,16 +12,69 @@
 tcode;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.Arrays;%0A
 import j
@@ -575,88 +575,332 @@
     
-// TODO%0A        return null;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B
+List%3CList%3CInteger%3E%3E answer = new ArrayList%3C%3E();%0A        for (int x = 1; x %3C= 1000 && x %3C= z; x++) %7B%0A            for (int y = 1; y %3C= 1000 && y %3C= z; y++) %7B%0A                if (customfunction.f(x, y) == z) %7B%0A                    answer.add(Arrays.asList(x, y));%0A                %7D%0A            %7D%0A        %7D%0A        return answer;
 %0A   

Solve problem 1237