arrow_back Back to Challenges

#122 Best Time to Buy and Sell Stock II

Medium Acceptance 0%
description

Problem Description

You are given an integer array `prices` where `prices[i]` is the price of a given stock on the i-th day. On each day, you may decide to buy and/or sell the stock. Find and return the maximum profit you can achieve. You may hold at most one share at any time.

checklist Constraints

See problem description for detailed constraints.

science Examples

Case #1

In: # See problem description for input format
Out: # Expected output

Mastery Tags

Arrays Dynamic Programming Greedy

Hiring Companies

Meta Salesforce
code

Integrated IDE

code_blocks
Coding
psychology
Aptitude