Split The Array Leetcode Solution Python