Leetcode Dynamic Array Problems In Python How To Sort