Maximum Score After Splitting a String - Leetcode 1422 - Python