DEV Community

Rishitha Nallapureddy
Rishitha Nallapureddy

Posted on • Edited on

My problem solving experience - 18-10-24

Hey, I am so glad to say that I have taken the next step in my competitive programming journey. I was starting from nothing about linked lists and have now started learning some of the tougher concepts. After covering all the basics, I moved on to more complicated topics. I've learned about linked lists and tackled a few related questions over the last few days. On Thursday I tried most of the questions using Dojo-related questions so that I can use some of them for my up-coming dojo this week. I prepared accordingly.

Friday ended solving all three advanced problems, which were Longest Valid Parentheses, Frog Jump, and Merge k Sorted Lists.

The first problem was Longest Valid Parentheses : given a string containing only parentheses, find the length of the longest valid substring of balanced parentheses. By using a stack to keep track of unmatched parentheses and their indices, I could compute the maximum valid length in an efficient manner.

For Frog Jump, I was to determine if a frog could cross the river by jumping between stones, where the length at each step depends on the length of the previous jump. This is a dynamic programming problem in which I had to construct a set-based state tracker for each stone and keep track of all the possible jump lengths.

Lastly, I worked on the problem of Merge k Sorted Lists. This is the classic problem where one must merge several sorted linked lists into one. Using a priority queue, I held up the smallest elements of all the lists and merged those up.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more