Say I have a list of 65 strings.
I need to split this single list into multiple "pools" that have a similar amount of strings.
The amount cannot be over 32.
In this list of 65, they're all ranked from 1st to 65th.
- For a list of 65 strings, it'd split into one pool of 21, and two pools of 22.
- For a list of 34 strings, it'd split into one pool of 18, and one pool of 18.
- For a list of 115 strings, it'd split into one pool of 28, and three pools of 29.
And so on.
However, the new lists need to be fairly ranked.
In example it should be like so:
- rank 1 in pool 1
- rank 2 in pool 2
- rank 3 in pool 3
- rank 4 in pool 1
- rank 5 in pool 2
- rank 6 in pool 3
This way, rank 1 and rank 4, become rank 1 and 2 in their new list.
Same goes for the rest.
I'm thinking I'd need to use array_chunk in combination with a modulo operation, but I can't seem to wrap my head around it.