We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
from functools import reduce
_, m = input(), 10 ** 9 + 7
print(reduce(lambda a, b: a * b % m, [1 + pow(2, int(x), m) for x in input().split()], 1) - 1)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Shashank and List
You are viewing a single comment's thread. Return to all comments →
Python 3 solution works fine: