DEV Community

Mukilan Palanichamy
Mukilan Palanichamy

Posted on

My journey in competitive programming

1. Permutations:

You are given a list of distinct numbers and you're asked to find all the possible unique arrangements (or permutations) of those numbers.

Real-Life Example:
Think of arranging three different colored blocks:

Blocks: Red (1), Blue (2), Green (3).
We can arrange them as:
Red, Blue, Green
Red, Green, Blue
Blue, Red, Green, and so on...

Image description

2. Permutations II:

Same, but skip duplicates using sorting and checks. We use swapping for skip duplication.

Real-Life Example:

Think of arranging three different colored blocks:

Blocks: Red (1), Blue (2), Red (3).
We can arrange them as:
Red, Blue, Red
Red, Red, Blue
Blue, Red, Red, and so on...

Image description

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay