Rosalind - Counting Subsets

rosalind

Problem:

Please find the problem here.

Solution:

The number of subsets of a set of size \( n \) is \( 2^n \). The following code implements the repeated squaring algorithm. The numbers are computed modulo \( 1000000 \) as soon as we are done with multiplying. This is done to keep the number small, and so that the multiplications are quick.

Code: