MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / compare_string

Function compare_string

boolean_algebra/quine_mc_cluskey.py:1–11  ·  view source on GitHub ↗
(string1, string2)

Source from the content-addressed store, hash-verified

1def compare_string(string1, string2):
2 l1 = list(string1); l2 = list(string2)
3 count = 0
4 for i in range(len(l1)):
5 if l1[i] != l2[i]:
6 count += 1
7 l1[i] = '_'
8 if count > 1:
9 return -1
10 else:
11 return("".join(l1))
12
13def check(binary):
14 pi = []

Callers 1

checkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected