All of my test cases failed in this question apply same logic as knapsack

@rohitkandpal683
Your mistakes :

  1. It was 0-N knapsack and not 0-1 knapsack.
  2. the question says The second line contains W space separated integers
  3. the weight of i’th bag was i+1 and not i, if you start i from 0.
    https://ide.codingblocks.com/s/250857