alg
alg copied to clipboard
Better `eventual_period`
It seems that eventual_period in unary_invariant and binary_invariant is needlessly quadratic time. If we keep track of when we saw each element, then when an element re-appears, we will instantly know that we already saw it. So the complexity ought to be linear.