Can Anyone solve it in O(n) time.

Revision en1, by RJO4, 2022-12-02 00:19:10

Given an array of n elements and an integer K, the task is to find the subarray with minimum value of ||a[i] + a[i + 1] + ……. a[j]| – K|. Array may contain negative values. N<=1e5.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English RJO4 2022-12-02 00:19:10 217 Initial revision (published)