Sum it up!

0

0 votes
Arrays, Easy, Strings, Simple-math
Problem

You will be given n binary strings.

Note: Binary string means string consisting of only 0s and 1s.

You need to add all these binary strings and output the answer in decimal.

As the answer can be very large, so modulo it by 1000000007 ((10^9)+7).

Note: Given strings may start with leading zeroes.

See Sample test-case for more understanding.


Input format:

First line consists of a number n.

Each of the next n lines consists of a Binary String.


Output format:

Output the required answer.


Constraints:

1 <= n <= 10^3

1 <= String-length <= 10^3

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

101 is 5 and 010 is 2.

Therefore, 5 + 2 = 7.

Also, 7 modulo 1000000007 = 7.

So, output is 7.

Editor Image

?