DEV Community

Mukilan Palanichamy
Mukilan Palanichamy

Posted on

My journey in competitive programming

1. Palindrome Partitioning:

Given a string, the task is to partition it into substrings such that every substring is a palindrome. We need to return all possible ways to partition the string.

Key points:

  1. A palindrome is a word that reads the same forward and backward, for example "madam" or "racecar."

  2. The aim is to find all ways to cut the string into palindromic pieces.

  3. Backtracking is mostly utilized to find all possible partitions.

Image description

2. Non-decreasing Subsequences:

Given an array of integers, the task is to find all subsequences of length 2 or more that are in non-decreasing order. Duplicates should be avoided.

Key Points:

  1. A subsequence is a sequence derived from the array by deleting some or no elements without changing the order of the remaining elements.

  2. Non-decreasing means each element in the subsequence is either equal to or greater than the previous element.

  3. The solution must avoid duplicate subsequences.

Image description

Top comments (0)