Google | 2Yrs Exp | Bangalore | Onsite round 2 | Online
Anonymous User
2244

Q) Given a sequence of boxes, each with some pens in it and a number X( > 0), choose two non-overlapping intervals of boxes such that:

  1. For each interval, the total number of pens in it is exactly X.
  2. The total number of boxes chosen is as small as possible.

Output the total number of boxes chosen.

Find size of smallest interval possible where sum of interval = X

Comments (8)