Implement retry(fn, maxAttempts) that calls fn() up to maxAttempts
times. Return the first successful result. If all attempts fail, throw the
last error.
solve(failCount, value) creates a function that rejects the firstfailCount times then resolves with value. It returns {result, attempts}.
Sample tests