DEV Community

Mukilan Palanichamy
Mukilan Palanichamy

Posted on

My journey in Competitive Programming

Today's Learnings: Palindrome Partitioning and Word Search

Hi, folks

I had an exciting couple of problems I have done, which really exercised my skills in solving problems today, Palindrome Partitioning and Word Search. So here is what I did for them:

Palindrome Partitioning

I began with Palindrome Partitioning. The task given was to partition a string into substrings such that every substring was a palindrome. The key in that was that a palindrome is a string that reads exactly the same forwards and backwards, and like "racecar." When working on this problem I was using backtracking techniques in order to find how it could be divided all the possible ways to confirm each part was a palindrome then continue on the others. It was a fun and challenging problem, and I learned how to use backtracking to break up a problem into manageable, smaller parts.

Image description

Word Search

I had Word Search, where the problem is to find a word in a 2D grid of characters. The word can be formed by connecting adjacent cells horizontally or vertically. I applied Depth First Search to scan the grid, searching for possible word formations starting from every position. I learned to search efficiently within the grid by marking visited cells and backtracking if a dead-end is encountered. This problem assisted me in the practice of depth-first search and in thinking how to explore a grid in all directions.

Image description

Top comments (0)