@@ -0,0 +1,604 @@
+from neighbors import neighbors%0Afrom pattern_to_number import pattern_to_number%0A%0Adef computing_frequencies_with_mismatches(text, k, d):%0A  frequency_array = %5B0%5D * 4**k%0A  for i in range(0, len(text) - k):%0A    pattern = text%5Bi:k%5D%0A    neighborhood = neighbors(pattern, d)%0A    for approximate_pattern in neighborhood:%0A      j = pattern_to_number(approximate_pattern)%0A      frequency_array%5Bj%5D = frequency_array%5Bj%5D + 1%0A  return frequency_array%0A%0A%0Aif __name__ == %22__main__%22:%0A  text = raw_input(%22Text: %22)%0A  k, d = map(int, raw_input(%22K / D: %22).split(%22 %22))%0A  print computing_frequencies_with_mismatches(text, k, d)%0A

Add computing frequencies with mismatches