DEV Community

Cover image for #10daysofcodechallenge by Ingressive for Good (#Day 9)
Dennar David
Dennar David

Posted on

#10daysofcodechallenge by Ingressive for Good (#Day 9)

I am close to the end of a 10-day coding challenge organized by Ingressive for Good and I'll be sharing my thoughts on Day 5 of the challenge.

Let me briefly describe how the challenge works before I share my experience with you. From September 21 through October 30, 2022, the challenge is to solve one common algorithm problem every day for ten days.

Today's algorithm problem was “Merge k Sorted Lists." It is the 23rd algorithm challenge on "Leetcode.com".

The algorithm for today involved sorting a linked list. The issue appeared straightforward at first glance because all you had to do to address it was take each element from each list, sort them, and then add them to a new list. But after trying numerous fruitless codes, I had to go look for linked list on Google.
I then developed a solution based on my studies. The solution was to divide the list into the smallest possible unit, take two lists at a time and arrange the elements in each list in the appropriate order. Repeat this process for all the pairs of lists.
The final list will be the necessary response.

This task was completed in javaScript, took 138 milliseconds to execute, and consumed 49 MB of memory.

I never believed I would make it this far thank you Ingressive for Good.

Top comments (0)