Algorithm · ByteDance · Hard
Task (Sliding-Window Variation) Given an integer list arr containing n values and an integer k, remove one and only one consecutive segment consisting of k elements from arr. Join the elements on either side of that removed segment, without changing their original ordering, to form the resulting array. For the array produced after the removal, determine its smallest valid index. The precise meaning of a valid index is defined in the underlying problem, but that definition is…
Checking your access…