0
Interview Question
you are given on integer N and integer array A as the input where N denotes the length of A.write a program to find the product of every element with its next consecutive integers on the number line and return the sum of these products
2 ответов
0
What if N was an odd number? there could be one orphan number in such case.
0
Just trying to understand, let's say given an array
A = [1,2,3,4]
The length of array is
N = 4
So the SOP (sum of product) is
1*2+2*3+3*4 = 2+6+12 = 20
Is this what you mean?