I have a list with a property called tamanho
which can contain two values: "M" or "I".
I need this list to be random, but with a grouping condition.
"M" would be half page and "I" would be whole. That is, I need to always have 1 integer and then 2 socks. Never 1 whole, 1 half and then 1 whole again.
I will use this to generate a PDF, as soon as it is sweeping the list it will insert 2 socks on the same page, or 1 integer, and never 1 half and one integer then, since the whole one will not fit on the same page half and will stay a space.
My question is about the logic that I need to apply to the list to get this result. I have no idea yet and need help.
ThecodeisjustaC#list.
List<Questao>questao=newList<Questao>();//questao.Questao.TipoTamanhoQuestaoacessaovalor"M" ou "I"