I was asked this question in an On-Campus Interview for Uber:
https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/
I tried to implement a naive solution that checks the rest of the array for every integer which I believe would run in O(n^2) time?
I was wondering if there was any Pythonic way to solve this problem using certain modules or functions or even just general logic that would run faster than O(n^2).