Shashank and List

  • + 0 comments

    C# one-line:

    static int solve(long[] a)=>(int)((a.Aggregate(new BigInteger(1), (b, n) => (b * (BigInteger.ModPow(2, n, 1000000007)+1))%1000000007)-1)%1000000007);

    Not very readable for java guys though...