If you did not have answers you could set up an equation and make a table of values.
7x+4y=22 where x and y are the two basket sizes.
x=1 means 7(1)+4y=22, 4y=15, no
x=2 means 7(2)+4y=22, 4y=8, y=2, yes
x=3 means 7(3)+4y=22, 4y=1, no
if a=7 and b=4 the answer is 2a+2b