Bloomberg interview question

Leetcode question on machine learning