Replace every array element by sum of previous and next
Given an array of integers, update every element with sum of previous and next elements with following exceptions. First element is replaced by sum of first and second. Last element is replaced by sum of last and second last. Examples: Input : arr[] = { 2, 3, 4, 5, 6} Output : 5 6 8 10 11 Explanatio