Python Practice Problems question 2 doubt

how can i remove that blank line between the first and second iteration?
if i remove print("\n") it combines both the lines instead

i tried a better approach
Python doubt 10
Python doubt 10-2

but i am getting a run error in test case 3 and i am unable to find any problem with the code

https://online.codingblocks.com/app/player/209779/content/201856/5027/code-challenge

Hey @devchopra999_11c6416ab7f09bbf,
We don’t need to make extra list in this question just use the divide an conquer approach here divide the question into small subparts and then try to solve every subpart then the question will be automatically solved.
You can try this:- Link

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

is that an editorial sir? bcz i dont want my marks to be deducted