A regex pattern consists of lowercase English letters and some wildcard characters (?") with any English character. Two patterns are called intersecting if the wildcard characters in the respective strings can be changed in a way to form the same string from both patterns. For example, pattern p= "?cc?" and q = "dc??" intersect as we can form s = "dccx" from both p and q. Given an array patterns of n regex strings, find the minimum number of '?' characters possible in a pattern that intersects with all the patterns. Given n=2, m = 10, patterns = [ha???rrank", "?a?ke?bank"] output-1 explanation-hacker?ank
Aucun commentaire:
Enregistrer un commentaire