JPMorganChase interview question

Leetcode max loss in stocks arranged in an array