leetcode #10 regular expression match improvement