Number of distinct subsets of a set | Python3 program to count number of distinct subsets in an array of distinct numbers ; Returns 2 ^ n ; driver code
import math NEW_LINE def subsetCount ( arr , n ) : NEW_LINE INDENT return 1 << n NEW_LINE DEDENT A = [ 1 , 2 , 3 ] NEW_LINE n = len ( A ) NEW_LINE print ( subsetCount ( A , n ) ) NEW_LINE