Update remove the duplicate element in the Array and Linklist without new space