remove duplicates from array You have given an array from which we need to remove duplicates. 

Rules:


First or immediate duplicates gets removed first.
Array contains natural numbers a[i]&gt;0 for i&gt;=0
no. of elements in the array is greater than 1 i.e. n&gt;1


e.g. 

{1,2,3,4,5,5,4,6,6,7,8}=&gt; {1,2,3,7,8}
{1,2,3,3,4,5,6,7,7,8} =&gt; {1,2,4,5,6,8}
{1,1,3,3,4,4,6,6}=&gt;{}
{4,2,6,8,3,1,1,3,8,6,2,4}=&gt;{}
{6,6,6,1}=&gt;{6,1}


Only adjacent duplicate elements like [1, 2, 2, 1] are removed, but not [1, 2, 1, 2]. This process is repeated until no further modifications are made.

For winning criteria is the one which gives the fastest result.
Python 2, 201 bytes



array = input()
index = 0
while index &lt; len(array) - 1:
&#9;if index &gt;= 0 and array[index] == array[index + 1]:
&#9;&#9;array = array[:index] + array[index + 2:]
&#9;&#9;index -= 1
&#9;&#9;continue
&#9;index += 1
print(array)


Try it online!

Optimizations thanks to Mr. Xcoder