---
title: "Discussion on \"122. Best Time to Buy and Sell Stock II\" | Hashnode"
description: "Discussion on \"122. Best Time to Buy and Sell Stock II\". problem link\nKey ideas\n\nAt each index i, we evaluate how much profit we can make if we buy at i and sell at i+1\nIf the profit is positive, we buy and sell.  if the profit is negative, we just don't do anything. \n\n\nAfter calculating the profit, we upd..."
url: "https://hashnode.com/posts/122-best-time-to-buy-and-sell-stock-ii/630b928443d7308e3e323e10"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [122\. Best Time to Buy and Sell Stock II](https://brianhu.hashnode.dev/122-best-time-to-buy-and-sell-stock-ii?utm_source=hashnode&utm_medium=feed)

problem link Key ideas At each index i, we evaluate how much profit we can make if we buy at i and sell at i+1 If the profit is positive, we buy and sell. if the profit is negative, we just don't do anything. After calculating the profit, we upd...

Aug 28, 2022 · 1 min read · brianhu.hashnode.dev  
Read the article

-   [#dynamic-programming](https://hashnode.com/tag/dynamic-programming)

## Written by

[Brian Hu](https://hashnode.com/@brianhu)

@brianhu

  
[View profile](https://hashnode.com/@brianhu)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
