#P3763. Gene Sequence Matching
Gene Sequence Matching
Gene Sequence Matching
At Garyton University's Institute of Biological Research, a gene sequence was discovered that determines whether a person likes lotus root. An individual carrying this gene exhibits a fondness for lotus root; however, researchers found that any modification of at most nucleotides in still results in the lotus root preference. Given a person's DNA sequence (which displays the lotus root liking trait), count the number of contiguous substrings of that can be transformed into by modifying at most nucleotides.
The mathematical condition is: For each contiguous substring of with , if the Hamming distance between and satisfies $$d_H(T,S) \leq 3,$$ then is a candidate gene location.
inputFormat
The input consists of two lines:
- The first line contains the DNA sequence $S_0$ of a person displaying the trait.
- The second line contains the gene sequence $S$.
outputFormat
Output a single integer representing the count of contiguous substrings of (of length equal to ) that can be transformed into by modifying at most nucleotides (i.e. having a Hamming distance of at most from ).
sample
ACGT
ACG
2