Minimum money needed getting wrong ans

@souravkhanna227 check the input format carefully and make array and take input accordingly.

https://ide.codingblocks.com/s/294437 still not working pls help

@souravkhanna227 there was some samll mistakes in your code i have commented that parts and updated them,look at this https://ide.codingblocks.com/s/296682