Duplicate-aware positional scoring

ID: duplicate-aware-positional-scoring

To score a guess against a fixed-length secret, first reserve every equal-position match. For the remaining positions, consume at most one unused secret occurrence for each cow. This two-stage rule prevents an earlier wrong-position token from using the occurrence needed for a later positional match. The sum of bull and cow counts is the multiset overlap of the two sequences. With only equality tests, deletion from a list gives a quadratic-time implementation; token-count maps can improve the allocation step when a suitable key representation is available.

New to topics? Read the docs here!