DEV Community

Mukilan Palanichamy
Mukilan Palanichamy

Posted on

My journey in Competitive programming

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 tow questions from the linked list concept on LeetCode: Merge k Sorted Lists, Reverse Linked List.

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.

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

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay