← All problemsSign in

1237. Find Positive Integer Solution for a Given Equation

LeetCodeMathTwo PointersBinary SearchInteractiveOpen on judge ↗

Given a callable function f(x, y) with a hidden formula and a value z, reverse engineer the formula and return all positive integer pairs x and y where f(x,y) == z. You may return the pairs in any order. While the exact formula is hidden, the function is monotonically increasing, i.e.: - f(x, y) < f(x + 1, y) - f(x, y) < f(x, y + 1) The function interface is defined like this: interface Custo

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start