Find minimal rate k and subset sum | Uber Interview Question