Regular Expression Matching DP concise