Problem Description
A data analyst is given an array stockPrices[], representing the prices of a stock over the past n days. The task is to select a subsequence of stock prices, referred to as selectedDays. This subsequence is considered balanced if the following condition holds:
For any i > 0,