Last Updated : 10 Apr, 2024

Given an array of positive integers {2, 3, 5, 4}. Find the total number of subsets and 2nd maximum sum subset.

(A) 16 and {3, 5, 4}
(B) 16 and {4, 5, 3}
(C) 16 and {4, 5, 2}
(D) 16 and {2, 5, 4}


Answer: (A) (D)

Explanation: Size of array is 4 so total number of subsets will be 2 raised to power of 4 which is 16. 2nd maximum sum subset will be {3, 5, 4}


Share your thoughts in the comments