121. Best Time to Buy and Sell Stock | Java | MANG Question | Leetcode | Tamil | code io
code io - Tamil
0:00 / 0:00
121. Best Time to Buy and Sell Stock | Java | MANG Question | Leetcode | Tamil | code io
19 343 просмотра · 2 года назад
code io - Tamil
329 тыс. подписчиков
19 343 просмотра · 2 года назад
121. Best Time to Buy and Sell Stock
https://leetcode.com/problems/best-ti...
In This video I have discussed a Naive approach to solve the problem and also have explained the Optimised approach and I have coded the solution in Python
GitHub link - Solution (Python, Java and C++)
https://github.com/c0de-i0/LeetCode-S...
Follow us on
Instagram
code io - / code.i.o
Goms - / goms.io
Siva - / siva.io
Linkedin
Code IO - / code-io-tamil-67682b20b
Goms - / gomathinayagam-avudaikumar-509a7716a
Siva - / sivasubramanian-a-443519225
121. Best Time to Buy and Sell Stock
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.
Return the maximum profit you can achieve from this transaction. If you cannot achieve any profit, return 0.
Tags
#leetcode #interview #interviewpreparation #interviewprep #geeksforgeeks #amazoninterviewpreparation #amazoninterviewquestionsandanswers #mang #faang #fang #google #googleinterview #netflixinterview #hackerrank #leetcodesolutions #leetcodequestions #python #pythonprogramming