Company: Future_first_17nov
Difficulty: medium
Problem Description Have the function ArrayChallenge(arr) accept the list of numbers held in arr, where each entry gives the price in dollars of a rare coin on that trading day, and return the biggest gain obtainable by purchasing the coin on day x and later selling it on day y, where y > x. For example: if arr is [44, 30, 24, 32, 35, 30, 40, 38, 15] then your program should return 16 because at index 2 the coin cost $24 and at index 6 the coin was worth $40, so buying at 24 and selling at 40 nets a gain of $16, the largest possible with this list of coin prices. When no gain can be made from the given coin prices, your program should return -1. For example: arr is [10, 9, 8, 2] then your program should return -1. Examples Example 1 Input: [10,12,4,5,9] Output: 5 Final Output: 5 Example 2 Input: [14,20,4,12,5,11] Output: 8 Final Output: EMPTY Follow-up Once your function returns a result, take that output string (the value produced by ArrayChallenge) and strip out any characters, ig