Let's say you have a string S and a sequence of digits in a list L such that len(S) = len(L).
What would be the cleanest way of checking if you can find a bijection between the characters of the string to the digits in the sequence such that each character matches to one and only one digit.
For example, "aabbcc" should match with 115522 but not 123456 or 111111.
I have a complex setup with two dicts and loop, but I'm wondering if there's a clean way of doing this, maybe by using some function from the Python libraries.