DEV Community

Mukilan Palanichamy
Mukilan Palanichamy

Posted on

My journey in competitive programming

1. Subsets II:

The Subsets II problem is similar to the Subsets problem, but given a collection of integers, including duplicates, the task is to find all possible subsets, without repeating any subset.

Example:
The list of numbers: [1, 2, 2]

[{}, {1}, {2}, {1, 2}, {2, 2}, {1, 2, 2}]

Note: Skip duplicates by checking if the current element is the same as the previous one and whether it’s being used already in the current subset.

Image description

2. Word Search:

In the Word Search problem you are given a 2D grid of letters along with a list of words. You need to determine, for each word in that list, whether it could be formed by a sequence of adjacent letters in the given grid. The words might be formed by moving both horizontally and vertically but in neither case diagonally while a cell can't be reused.

Image description

Top comments (0)