Leetcode Smallest Value Array Python Memory