I know my code is not optimal but at least is shall work. However, I got this:

Any one has any idea why is that?


The tricky part is, nums is the output. There is no need to return anything!!!