- #1
aihaike
- 55
- 0
Dear all,
I'm trying to figure about an efficient way to to get the redundant element in my array.
For instance, let's take the array [0,2,3,0].
I'd like to get out [2,0,3] (or 3,0,2 it doesn't matter).
So it find out which element is duplicated, an puts its value in between the 2 other elements.
The size of my initial array is always 4 and the final one always 3.
The duplicated element can have any index.
It's look very simple, and it certainly is, but I can not figure.
Some help would be very helpful.
Thanks in advance,
Eric.
I'm trying to figure about an efficient way to to get the redundant element in my array.
For instance, let's take the array [0,2,3,0].
I'd like to get out [2,0,3] (or 3,0,2 it doesn't matter).
So it find out which element is duplicated, an puts its value in between the 2 other elements.
The size of my initial array is always 4 and the final one always 3.
The duplicated element can have any index.
It's look very simple, and it certainly is, but I can not figure.
Some help would be very helpful.
Thanks in advance,
Eric.