โ† Visa questions
CodingReported in a candidate post, Dec 2023

Best time to buy and sell stock with cooldown

Filed under Visa

Given an array of prices where prices[i] is the price of a stock on day i, find the maximum profit. You may complete as many transactions as you like, but you must cooldown for one day after selling.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Visa questions

Collected from public candidate posts and coding forums. Updated Nov 2026.