Uber Interview Question

leetcode medium problem and an ml problem