I have a boolean array with a fixed length. Values are defaulted to false.
I need to fill the array with N values of true, that are mostly evenly distributed and spreaded over the array.
For example: If length is 7 and N is 3, it would look something like this:
[false, true, false, true, false, true, false]
If length is 14 and N is 5, it would look something like this:
[false, false, true, false, false, true, false, false, true, false, true, false, true, false]
The thing is, there isn't a strict rule of how to spread it, only that it should be spreaded mostly in an even matter (perhaps with a rule that the first and last elements won't be true, but not necessary).