The groupings just break the constant part of the term into different sums. For example, the constant 3 can be 2+1 or 1+2. So the grouping for a+b+3 can be a+1+b+2 or a+2+b+1. And we can add brackets to highlight the grouping: (a+1)+(b+2) or (a+2)+(b+1). The brackets aren’t necessary, but they just show groupings.
As the constants get larger we can split the sums in more ways. So, for example, 5 can be 4+1, 3+2, 2+3, 1+4 and we can combine these with the letters so we can have a+4+b+1, a+3+b+2, a+2+b+3, a+1+b+4. All these are the same as a+b+5. The brackets can be added so that we have a letter variable and a number collected together in the same bracket. I think this grouping was done to confuse the question. The questioner wanted to see if you could see through the disguise to test your understanding of arithmetic series. In fact the questioner could have introduced a weird grouping like (a+2+b)+3, for example. If you see through the disguise you would know it was the same as a+b+5 and you wouldn’t be fooled.