Leetcode Smallest Value Array Python Question