Available question text
Given an array of stock prices, find two indices i < j that maximize a score defined by a linear combination of prices and their indices (e.g., price[j] - price[i] plus or minus a term proportional to j−i). Solve in linear time by transforming the expression and scanning while maintaining the best prefix value (greedy / dynamic programming pattern).
Related questions
Continue with questions that share topics or the same question type.
- Find and Count Maximum-Score Grid Paths
Coding · Dynamic Programming · Grids & Matrices
- Find the Maximum Divisibility Score
Coding
- Find the Maximum Factor Score of Array
Coding
- Get the Maximum Score
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2898. Maximum Linear Stock Score
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source