Keyboard Row Leetcode Solution Python