I am calculating the Hamming distance between 2 strings where Hamming(A,B) == Hamming(B,A)
The function signature is
@lru_cache
def Hamming(A:str,B:str)->int:
...
How can I modify @lru_cache or the function to ignore argument order when indexing into the cache?
You can insert an extra function call that predictably rearranges the arguments: