Interview Question: Modify array with max performance
Given an array of integers, update the index with multiplication of previous and next integers, e.g. Input: 2 , 3, 4, 5, 6 Output: 2*3, 2*4, 3*5, 4*6, 5*6 Please suggest an approach that gives output with maximum performance:
Given an array of integers, update the index with multiplication of previous and next integers, e.g.Input: 2 , 3, 4, 5, 6Output: 2*3, 2*4, 3*5, 4*6, 5*6 Please suggest ...