Amazon Interview Question

three some problem from Leet code with optimization, LP of amazon