Leetcode Smallest Value Array In Python