Math, asked by Susan4433, 10 months ago

Find all subset of length 2 and 3 whose sum is divisible by 3

Answers

Answered by Anonymous
6

Answer:

Input : arr[] = {1, 2, 3};

m = 3;

Output : 3

Subsequence of given set are

{1}, {2}, {3}, {1, 2}, {2, 3}, {1, 3} and {1, 2, 3}.

And their sums are 1, 2, 3, 3, 5, 4 and 6.

Input : arr[] = {1, 2, 3, 4};

m = 2;

Output : 7

{2}, {4}, {1, 3}, {2, 4}, {1, 2, 3}, {1, 3, 4}

and {1, 2, 3, 4}

Similar questions
Math, 5 months ago