题目
挺有意思的一道题。就是给了个黑盒子,遍历一下,找出满足要求的值就可
class Solution {
public List<List<Integer>> findSolution(CustomFunction customfunction, int z) {
List<List<Integer>> list = new ArrayList<>();
for(int x=1;x<=1000;x++){
for(int y=1;y<=1000;y++){
if(customfunction.f(x,y)==z){
List<Integer> tmp = new ArrayList<>();
tmp.add(x);
tmp.add(y);
list.add(tmp);
}
if(customfunction.f(x,y)>z) break;
}
}
return list;
}
}