Available question text
Given an array, maximize the rotation function F(k) = sum_{i=0}^{n-1} i * arr_k[i] over all k (rotating the array by k positions), with n up to 1e5. The core challenge is to avoid O(n^2) recomputation by using a mathematical recurrence to update F for each rotation in O(1), achieving an overall O(n) solution.
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 396. Rotate Function
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source