Number of distinct subsets of a set | Java program to count number of distinct subsets in an array of distinct numbers ; Returns 2 ^ n ; Driver program to test above function
class GFG { static int subsetCount ( int arr [ ] , int n ) { return 1 << n ; } public static void main ( String [ ] args ) { int A [ ] = { 1 , 2 , 3 } ; int n = A . length ; System . out . println ( subsetCount ( A , n ) ) ; } }