Elements in Array After Removing and Replacing Elements - DSA Problem | Talentd