DEV Community

Karthika Movva
Karthika Movva

Posted on

In my Problem Solving Journey

Hey, glad to report that I could push my competitive programming career forward. I begin from scratch on linked lists and have started learning some more complex concepts. After all, I had mastered the basics so I jumped to more complex topics. I've learned about linked lists and could solve a few questions based on this for the last two days. Today, I have practiced questions on Dojo as I have to answer them this week in my dojo. So, I was prepared for that. Therefore, today, I have practiced three different questions that were based on linked lists. One was a tough question and was based on the concept of a matrix, and the other two were at a moderate level of difficulty.

For the first question, I was working on a matrix problem where we had to rotate the given matrix. For the first index (0), we had to rotate it clockwise once and then print it out using a linked list. The next question was about the life cycle, where we used the rabbit and tortoise algorithm. In this question, if both the rabbit and the tortoise move in a straight line, then they won't meet; but if they move in a circle, then they will eventually meet at one point. And that point is telling us that a cycle exists. We have a cycle if we return true; otherwise, we return false.

Last but not least, I solved a remove duplicates question where we were given a sorted array and had to remove all the duplicate numbers and print the new array. For example, if the array is [0, 1, 1, 2, 2], we remove all the repeated numbers, and the output should be [0, 1, 2]. The day was great and productive overall.

Top comments (0)