Micron Technology Interview Question

some optimization problem