Leetcode Nonetype Object Is Not Iterable