Retry a Promise Task

JavaScript Medium 4 views
Back to Questions

Problem Description

You are given two integers: attempts and failCount. Simulate a task that fails first failCount times and then succeeds. Using async/await, retry until success or attempts finish. Print SUCCESS or FAIL.

Input Format

One line: attempts failCount.

Output Format

SUCCESS or FAIL.

Sample Test Case

Input:
5 3
Output:
SUCCESS

Constraints

0

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Next