distinct-elements-enables-first-element-argmax

Status: IN

With distinct elements, the lexicographically largest subarray of length k always starts at the position of the maximum value in `nums[0:n-k+1]` — no need to compare subsequent elements.

Source: entries/2026/06/06/largest-subarray-length-k-solution.md

JSON