This code creates a Spring Boot application with a REST endpoint /maximizeDiscount It will accept a list of product prices as input. It calculates the discounted and payable items for you.
You can test this endpoint using any REST client preferably postman , by sending a POST request to http://localhost:8080/maximizeDiscountOffer1 http://localhost:8080/maximizeDiscountOffer2 http://localhost:8080/maximizeDiscountOffer3 Use a JSON body containing the list of product prices. For example:[10, 20, 30, 40, 50, 60]
This should return a JSON response with discounted and payable items.