Given an array of integers, update every element with multiplication of previous and next elements with following exceptions.
- First element is replaced by multiplication of first and second.
- Last element is replaced by multiplication of last and second last.
Input: arr[] = {2, 3, 4, 5, 6}
Output: arr[] = {6, 8, 15, 24, 30}