Ответсообщение недоступно
You don't have to
Just iterate through the list and keep track of your index number, when you take an element off the list, the list gets smaller, so your next element is the same index as the last, so you don't increase the index after using the pop function.
The index is so you can tell your pop function where the element is