We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Was one of the toughest challenges in terms of amount of time it took to get all the boundary conditions correct.
I went through the Editorial after I solved the problem, although the approach itself is somewhat OK to understand by reading the editorial, I'm sorry to say that the code given is hardly readable. Especially using single letter variable names for arrays, and even more - using the same variable names for an array declared in the beginning of the code and re-using the same variable for the loop iterator as well, just adds more confusion when looking at the code. I believe it could be improved to make it easier to understand for a reader who did not solve the problem on his/her own.
Here is my submission if someone wants to look at an easier to read code using a similar approach mentioned in the editorial.
Reverse Shuffle Merge
You are viewing a single comment's thread. Return to all comments →
Was one of the toughest challenges in terms of amount of time it took to get all the boundary conditions correct.
I went through the Editorial after I solved the problem, although the approach itself is somewhat OK to understand by reading the editorial, I'm sorry to say that the code given is hardly readable. Especially using single letter variable names for arrays, and even more - using the same variable names for an array declared in the beginning of the code and re-using the same variable for the loop iterator as well, just adds more confusion when looking at the code. I believe it could be improved to make it easier to understand for a reader who did not solve the problem on his/her own.
Here is my submission if someone wants to look at an easier to read code using a similar approach mentioned in the editorial.