Not able to understand the problem statement completely

I would really appreciate a detailed explanation of what the problem is asking to do. Some questions such as,

  1. Can there be only girl or only boy present?
  2. Do we just need to take orientation into consideration, like in 2 boys 1 girl there’s only “2 boys then 1 girl” or “1 boy 1 girl then 1 boy” also?

Thanks.

Hey yes you need to take all the valid combinations.
According to the input you are given number of boys(b), number of girls(g), number of boys that can be together atmost(n1) and number of girls that can be together atmost(n2).

Consider b = 2, g = 3, n1 = 2 and n2 = 2
So valid combinations are -
ggbgb
ggbbg
gbggb
gbgbg
gbbgg
bggbg
bgbgg

So there are 7 possible combinations satisfying above criteria.

Ohkay, got it. Thanks.