I have a basic algorithm question and know that there will be a very simple and efficient solution which replaces the looping and keeping track of variables version I currently have.
I have a cursor with a list of key values such as -> AAAABBBBBCCCDDE (alpha value is simply for illustration)
I want to produce a cursor with those values spread as evenly as possible by frequency, eg (done quickly by hand so not precise):
BACBADBECBADBCA
In a nutshell, my current methodology is to track how often each element should appear in the list (eg. B should be one in every 3 (15/5)) and then insert based on that.
I'm confident that there is someone out there who will make me slap my head in disgust by listing the simple & elegant solution that I should have come up with in the first place :)
Cheers,
Jamie
Cheers,
Jamie