need help in understanding the time complexity of the following

I was taking part in a practice contest and I noticed that my program was slower when I used the lines


Which is contrary to what I’ve read can someone please explain this

It shouldn’t be like that… Can you share solution link ?

share your code.