Find the contiguous interval of at least K elements with the maximum sign-twisted sum.
Unlock detailed company stats for this questionUpgrade
Given an integer array A of performance changes of an ML model's recommendations over N intervals (positive values are improvements, negative values declines), find a non-empty contiguous interval [i..j] of size at least K that maximizes the cumulative improvement, where the sum is computed as -1*A[i] + A[i+1] + ... + A[j]. The first element of the selected interval is negated.
Format · DSA round of an Applied Scientist loop.
Community answers
No answers contributed by the community yet.


