Collect Promise Errors

JavaScript Hard 4 views
Back to Questions

Problem Description

Given n and n integers. For each integer x, create a promise that rejects if x is odd, resolves if x is even. Wait all and print count of rejects.

Input Format

Line1: n. Line2: n integers.

Output Format

One integer rejectCount.

Sample Test Case

Input:
5 1 2 3 4 5
Output:
3

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next