HF RL Explorer

Maximum Single-Sell Stock Profit

Maximum Single-Sell Stock Profit: a task in Terminal-Lego-15k (Harbor dataset). You are given an array of integers representing stock prices on consecutive days. Your task is to implement an efficient algorithm that finds the maximum profit that can be achieved by buying the stock on one day and…

The task

You are given an array of integers representing stock prices on consecutive days. Your task is to implement an efficient algorithm that finds the maximum profit that can be achieved by buying the stock on one day and selling it on a later day (or the same day).

Part of PrimeIntellect/Terminal-Lego-15k.