yono.dev

LeetCodeがんばるぞ

2024-03-30から1日間の記事一覧

121. Best Time to Buy and Sell Stock

問題概要 integerの配列 prices が入力値 prices[i] - prices[j] ( i < j ) が最も大きい組み合わせを見つければ良い 単純にループを二重にすると Time Limit Exceeded になるので工夫が必要 問題URL:https://leetcode.com/problems/best-time-to-buy-and-s…