Find the largest numer for array after operation

34 Views Asked by At

Tom wants to find the maximum value after doubling each element in an array. He defines f(i) as: the maximum value of the array after doubling the i-th element. Tom expects to find the values of f(1) to f(n), where n is the length of this array. For example, if the array sequence is 1, 3, 2, 5, 4, then the output result would be: 5, 6, 5, 10, 8.

0

There are 0 best solutions below