Sort by

recency

|

37 Discussions

|

  • + 0 comments

    Find the best collection of Bridal Clutch online in Pakistan. Walkeaze offers the best quality bridal clutch for ladies online all over Pakistan. So, grab your favorite clutch online at low prices.

  • + 0 comments

    Java 8 solution:

    public static int solve(List<Integer> a) 
        {
            int even_number=0;
            int odd_number=0;
            int i;
            for(i=0;i<a.size();++i)
            {
                if(a.get(i)%2==0)
                {
                    ++even_number;
                }
                else
                {
                    ++odd_number;
                }
            }
            BigInteger even_comb = BigInteger.valueOf(2).pow(even_number).subtract(BigInteger.valueOf(1)).mod(BigInteger.valueOf(1000000007));
            BigInteger odd_comb =odd_number>0? BigInteger.valueOf(2).pow(odd_number-1).subtract(BigInteger.valueOf(1)).mod(BigInteger.valueOf(1000000007)):BigInteger.valueOf(0);
            BigInteger total_comb = even_comb.multiply(odd_comb).mod(BigInteger.valueOf(1000000007));
            BigInteger ans = even_comb.add(odd_comb).add(total_comb).mod(BigInteger.valueOf(1000000007));
            return ans.intValue();
        }
    
  • + 0 comments

    The problem description is exactly why I hate HackerRank.

  • + 0 comments

    FYI nice explanation on the used combinatorial identity: https://math.stackexchange.com/questions/1072881/is-there-a-closed-form-formula-for-sum-of-odd-combinations

  • + 0 comments

    def solve(a): if len(a) == 0: return 0 evn = [nmbr for nmbr in a if nmbr%2==0] od = [nmbr for nmbr in a if nmbr%2!=0] ven = 2**(len(evn)) - 1 if len(od) > 0: do = 2**(len(od)-1) - 1 else: do = 0 tot = ven+do+do*ven return tot%1000000007