Point72 interview question

python problem was similar to leetcode easy