Shashank and List

Sort by

recency

|

14 Discussions

|

  • + 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...

  • + 1 comment
    m = 1000000007
    result = 1
    
    for i in range(len(a)):
        result = result * (1+pow(2,a[i],m))
    result = result-1
    
    return int(result%m)
    
  • + 0 comments

    movies

  • + 0 comments

    nice blog https://luxurystruggle.com/

  • + 1 comment

    My code is giving timeout on case 7,8,9,10. can anyone help?

    import sys
    import math
    T = int(input())
    N=[]
    res=1
    
    n=input().strip().split(' ')
    for j in n :
    	N.append(int(j))
    
    for i in N:
    	res=res*(2**i+1)%(10**9 + 7)
    	
    print(res-1)