We add some documentation, fixup the typing signature, refactor the function to use return sorted lists, modify some implementation details and add comments to the function. We return sorted lists, because we have been bitten in the past by using sets and them being unordered.
We add some documentation, fixup the typing signature, refactor the function to use return sorted lists, modify some implementation details and add comments to the function. We return sorted lists, because we have been bitten in the past by using sets and them being unordered.