TheChetan icon

No dups Sets

TheChetan | PRO | 07/05/21 10:03:32 AM UTC (Edited) | 0 ⭐ | 1010 👁️ | Never ⏰ | []
text |

410 B

|

None

|

0 👍

/

0 👎

4. Given a set of numbers, find the number of subsets of size 3 such that:
The first number divides the second,
And the second number divides third.
Bonus: Extend the problem to cover subsets of size 'n'.
Note: There wont be any duplicates
 Ex: [1, 2, 3, 4, 5, 6]
[1, 2, 4], [1, 2, 6], [1, 3, 6] = 3
 Ex: [1, 3, 5, 9, 10, 90]
[1, 3, 9], [1, 3, 90], [1, 5, 10], [1, 5, 90], [1, 9, 90], [3, 9, 90], [5, 10, 90] = 7

Comments