Given an array, identify duplicate elements. For each duplicate, replace the middle occurrence with the sum of all occurrences of that element, while maintaining the relative order of other elements.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.