1 class Solution: 2 def findSolution(self, customfunction: 'CustomFunction', z: int) -> List[List[int]]: 3 x,y = 1,1001 4 res = [] 5 while x < 1001 and y > 0: 6 v = customfunction.f(x,y) 7 if v < z: 8 x += 1 9 elif v > z: 10 y -= 1 11 else: 12 res.append([x,y]) 13 x += 1 14 y -= 1 15 return res