Basic Array Maintenance

I'm having a bit of trouble with something that should be pretty easy. I have list of words and I need to shift all members of the array up one place if there's a duplicate, so I'm using something that looks like: