There is an array of even lengths given. The elements of an array represent coins of different values. You have to select either the first or last coin from the row and determine the maximum possible amount you can get.
Write a function
solve that have the following parameter(s):
1.) arr = an array of integer
arr = [1, 8, 2, 10]
The maximum number you get from collecting coins of value