Close
Topic list
Anuj and Subsets
EASY
15 mins
Other topics
Problem solved
Skill meter
Strings
-
-
Matrices (2D Arrays)
-
-
-
-
Sorting
-
-
Binary Search
-
-
Stacks & Queues
-
-
Trees
-
-
Graph
-
-
Dynamic Programming
-
-
Greedy
-
-
Tries
-
-
Arrays
-
-
SQL
-
-
Binary Search Trees
-
-
Heap
-
-
Bit Manipulation
-
-
Solve problems & track your progress
Checkout your overall progress in every topic here
Become
Sensei
in DSA topics
Open the topic and solve more problems associated with it to improve your skills
Check out the skill meter for every topic
See how many problems you are left with to solve for cracking any stage. Score more than zero to get your progress counted.

# Anuj and Subsets

Contributed by
Jaypal Mudaliyar
Easy
0/40
Avg time to solve 15 mins
Success Rate 85 %
Share

## Problem Statement

#### The answer can be very huge, so print the answer modulo 109+7.

##### EXAMPLE :
``````Input: ‘N’ = 3, ‘ARR’ = {2, 5, 8}

Output: 3
In this case, there are ‘3’ possible even sequences i.e. [2], [8], and [2, 8].
``````
Detailed explanation ( Input/output format, Notes, Constraints, Images )
##### Sample Input 1 :
``````2
5
1 2 3 4 5
5
3 2 2 1 6
``````
##### Sample Output 1 :
``````3
7
``````
##### Explanation Of Sample Input 1 :
``````For the first test case, the even elements of the array ‘ARR’ are [2, 4]. Hence the non-empty even sequences are - [2], [4], [2, 4].

Hence, the output will be: 3

For the second test case, the even elements of the array ‘ARR’ are [2, 2, 6]. Hence the non-empty even sequences are - [2], [2], [6], [2, 2], [2, 6], [2, 6], [2, 2, 6].

Hence, the output will be: 7
``````
##### Sample Input 2 :
``````2
10
16 4 12 6 10 2 18 2 14 20
8
1 5 3 9 7 5 3 11
``````
##### Sample Output 2 :
``````1023
0
``````
Auto
Console