Luminovo Interview Question

optimization and probability