Goldman Sachs interview question

Buying & Selling stock. It was literally this question here: https://leetcode.com/explore/interview/card/top-interview-questions-easy/97/dynamic-programming/572/