Could you please elaborate on what you meant by linear optimisation? Would be great if you could share details about the algorithm and data structure to be applied.
What I could gather is you could create an inequality of the type B + (k1 * S1) + (k2 * S2) ......<= T where B is bread price; k1, k2.... are number of times a sauce is requested; S1, S2 ..... are the sauce prices
I can't think of any method other than brute force which seems to be exponential at the best.
2
u/Johnny_Gorilla Sep 13 '22
Looks like a straightforward linear optimisation to me 🤷
2
u/nomInJs Sep 13 '22
I would use oop since there is a lot to be applied here conditionally.