Given an incoming stream of characters containing values like $300 and £400, write getValues(symbol, stream) that returns the array of values for that symbol.
Asked in the phone screen stage. getValues("$", "abc \$300 £400 \$30 abvv cvc") returns [300, 30]. Reported follow-up: how will you handle tokens like $\$300 and \$200\$300 when you cannot peek the next value?
symbol: a single-character string such as "$" or "£"stream: a string containing arbitrary characters and zero or more currency valuesdef getValues(symbol, stream):