infosys online coding round

How can i solve this problem.Is it greedy or Dp problem???
sorry for the bad image qualiy pic took during the coding round.....image
image
image

Comments (2)