Interview Problem

Revision en1, by sagnihotri, 2017-12-03 21:03:41

Given an array of non negative integers . find the sub-array with sum closest to a number T.
I was asked to answer M queries and in each query we are give number T.
I came up with a solution of nlogn + m*n*logn but interviewer was not satisfied and wanted me to come up with nlogn + m*n solution.
(He rejected me solely on this )
.

Tags #interview

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English sagnihotri 2017-12-04 07:10:22 23 Tiny change: ' integers . find the' -> ' integers (positive and negative). find the'
en4 English sagnihotri 2017-12-03 21:12:29 40
en3 English sagnihotri 2017-12-03 21:11:31 155
en2 English sagnihotri 2017-12-03 21:09:21 13 Tiny change: ' array of non negative integers ' -> ' array of integers '
en1 English sagnihotri 2017-12-03 21:03:41 370 Initial revision (published)