Topic: Greedy Algorithm Problem / Level: intermediate

Problem: You are given an array of integers representing stock prices. Find the maximum profit you can make by buying and selling the stock at most twice.

Run the code to see the output here...