Doubt by Maria

two chambers containing m1 g and m 2g of gas at pressure p1 and p2 respectively are put in communication with each other the temperature remaining constant pressure reached will be answer is= P1P2(m1+m2) / (P2m1+P1m2) . what's wrong in the solution I did? please explain.