Promise.any First Success

JavaScript Medium 3 views
Back to Questions

Problem Description

Given n numbers, a task succeeds if number is divisible by 5. Run tasks and print the first successful number in input order. If none, print ALL_FAIL.

Input Format

Line1: n. Line2: n integers.

Output Format

Number or ALL_FAIL.

Sample Test Case

Input:
6 1 10 3 25 7 5
Output:
10

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next