DEV Community

vinnu gollakoti
vinnu gollakoti

Posted on

Day 44 Journal

Hi, Folks! Today I want to share my experience in LeetCode problem-solving. I am a beginner in data structures and algorithms, and currently, I am focusing on Python. I solved three questions from the linked list concept on LeetCode: Merge k Sorted Lists, Reverse Linked List, and Add Two Numbers.

For the problem Merge k Sorted Lists, there are many approaches you can choose. But, choosing the most efficient one comes with practice. As a beginner, I started with this approach: I created a new list, merged all the given lists into the newly created list, and then sorted it.

After completing the coding part, I wanted to know if there were any other approaches. So, I went through some resources and discovered that there is an even more efficient way using a min-heap. I found this approach to be more logical compared to mine, and this realization comes only with practice. If we can think of the most efficient logic in our first approach, it indicates that we are experts in programming.

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly — using the tools and languages you already love!

Learn More

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay