Because you’re mutating the array as you remove items from it.
Let’s say you remove the item at [i], now the item that was just at [i + 1] is now at [i]. But then the loop goes to the next iteration. Hence, that items gets skipped.
yes, thank you for the detailed explanation, i saw the hints and they mentioned filter and push methods. I wanted to try out splice as i had just learnt it in the previous challenge. But my logic was not correct