Available question text
Given nums and k, each operation picks an unused subarray and multiplies the score by the element in that subarray with the largest number of distinct prime factors (ties broken by smaller index); maximize the final product mod 1e9+7 after at most k operations. The algorithmic core is computing for each element how many subarrays would select it as the prime-score winner (with tie-break), typically via a monotonic-stack range-count, then greedily using those counts to pick the largest values up to k multiplications.
Related questions
Continue with questions that share topics or the same question type.
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 2818. Apply Operations to Maximize Score
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source