Compute max reachable cells per threshold | Uber Interview Question