// we need to tell how many times string 2 appear in string 1 // here, bag occurs 5 times in string 1 // f(n-1, m-1) means number of distinct subsequences of string ...
self.f_max = [[0] * self.max_log for _ in range(self.n)] self.f_min = [[0] * self.max_log for _ in range(self.n)] self.lg = [0] * (self.n + 1) for i in range(2, self ...