DEV Community

Mukilan Palanichamy
Mukilan Palanichamy

Posted on

My journey in competitive programming

1. Subsets:

A subset is any group of items that can be selected from a larger set, including the possibility of selecting no items at all.

Example:

Imagine you have a set of 3 numbers: 1, 2, and 3.

Possible subsets:
[{}, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}]

Image description

2. Combinations:
A combination is a way of selecting items from a group, where the order does not matter.

Example:
The set: 1,2,and 3.

Possible combinations of two numbers:
[{1, 2}, {1, 3}, {2, 3}]

Image description

Top comments (0)