Company: Future_first_17nov
Difficulty: medium
Array Challenge Problem Description The function ArrayChallenge(arr) receives an array of integers in which arr[i] is the price in dollars of a single stock on day i . Return the maximum profit that could have been made by buying the stock on some day x and selling it on a later day y , with y > x . If no pair of days gives a positive profit, the result is -1 . Then apply the ChallengeToken filter: take the result as a string and remove from it every character that appears in your ChallengeToken, ignoring case. If what is left is empty, return the word EMPTY instead. Your ChallengeToken: n6fq9oc8d3 The filter applies only to the result string, never to the input. Input Format A single line holding the array in bracket form, for example [10,12,4,5,9] . Spaces after the commas are allowed. Output Format Print the filtered result string on one line: the digits that survive the filter, the string -1 , or the word EMPTY . Constraints 1 <= n <= 20000 , where n is the number of price