ravya1108 / hactoberfest2023

20 stars 257 forks source link

Stock Buy Sell to Maximize Profit using Local Maximum and Local Minimum #187

Open m-soumik opened 11 months ago

m-soumik commented 11 months ago

In this approach, we will find the local minima and maxima. The local minima will be treated as the starting index, and the local maxima will be treated as the ending index. If local minima do not exist, then return. We will also be updating the solution by updating the count of buy-sell pairs.