Topic: Greedy Algorithm Problem / Level: intermediate

Problem: You are given an array of integers representing stock prices where each element is the price of the stock on that day. Find the maximum profit that can be made by buying and selling the stock at most once.

Run the code to see the output here...