you are given an array a that contains N elements. you have to create a group consisting of some elements from the array
Share
you are given an array a that contains N elements. you have to create a group consisting of some elements from the array
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Explanation:
Input: arr[] = {3, 6, 7, 2, 9} Output: 8 // Groups are {3,6}, {3,9}, {9,6}, {7,2}, {3,6,9}, // {3,7,2}, {7,2,6}, {7,2,9} Input: arr[] = {2, 1, 3, 4} Output: 4 // Groups are {2,1}, {2,4}, {2,1,3}, {2,4,3}