Point72 Interview Question

python problem was similar to leetcode easy