you give integer array price pricesi price ith item shopThere special discount item shop if buy ith item receive discount equivalent pricesj j minimum index j pricesj pricesi otherwise receive discount allReturn integer array answer answeri final price pay ith item shop consider special discount example 1input price 84623output 42423explanation for item 0 price08 receive discount equivalent prices14 final price pay 8 4 4for item 1 price14 receive discount equivalent prices32 final price pay 4 2 2for item 2 price26 receive discount equivalent prices32 final price pay 6 2 4for item 3 4 receive discount allexample 2input price 12345output 12345explanation in case item receive discount allexample 3input price 10116output 9016 Constraints1 priceslength 5001 pricesi 1000