Here’s my solution: Link to my code.
It works on the sample input given. I don’t think the list indices are going out of range.
Here’s my solution: Link to my code.
It works on the sample input given. I don’t think the list indices are going out of range.