Given string and pattern , implement regex matching. '.' matches any single character. '*' matches zero or more of the preceding element.
Example: s = "aab", p = "cab" matches. The 'c*' matches zero 'c's, 'a*' matches two 'a's, 'b' matches 'b'.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
LC 10 - dot and star patterns
Given string and pattern , implement regex matching. '.' matches any single character. '*' matches zero or more of the preceding element.
Example: s = "aab", p = "cab" matches. The 'c*' matches zero 'c's, 'a*' matches two 'a's, 'b' matches 'b'.