generating all subsets
for i in range ( 1 , ( 1 << N ) ) : NEW_LINE INDENT temp = [ ] NEW_LINE for j in range ( N ) : NEW_LINE INDENT if ( ( i & ( 1 << j ) ) != 0 ) : NEW_LINE INDENT temp . append ( A [ j ] ) NEW_LINE DEDENT DEDENT flag = 0 NEW_LINE DEDENT