LeetCode Problem: 121. Best Time to Buy and Sell Stock | Java Solution

preview_player
Показать описание
You are given an array prices where prices[i] is the price of a given stock on the ith day.

You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock.

Find the complete playlist of LeetCode Problems

---------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

Do checkout other videos

Follow Us
Рекомендации по теме
Комментарии
Автор

If you have a better solution, please comment.
and if you found this video helpful do check out the whole playlist

codeforinterview
Автор

Glad to see someone is explaining these solutions in layman terms.

mayankmittal
Автор

How to find and return the indices of best day to buy and best day to sell with max profit?

TrungNguyen-eoqz