Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Instead of adding two while loop just use the insert command - a.insert(0, a.size() - b.size(), '0').
Stop using reverse just initialise the loop from the end of the strings and run a backwards loop, reverse is adding to the time complexity and is anyway unneccesary step to worry about.
This comment is hidden because it contains spoiler information about the solution
Code is definitely cluttered, try to remove the unneccessary bool conditions and make it simpler to read
A similar thing happened to me (I code in cpp not python), since it is a bigger code than normal, I first made the code in vs and then copied it here after running all the simulations I thought were needed.
And moreover the error message was really ambigous.
So I had to instead look at the testcases and identify in which testcase the problem was occuring.
P.S. it was {{1}}
I wanna add the fact that I checked many solutions that are using two loops and at first I thought that is an alternative to using variables such as gap(for index gap / margin) or counter(is a sense of direction), however they were used by others as well, so you really don't need to use more than one loop.