In this question,
A circus acrobat of mass $M$ leaps straight up with initial velocity $v_0$ from a trampoline. As he rises up, he takes a trained monkey of mass $m$ off a perch at a height $h$ above the trampoline. What is the maximum height attained by the pair? [Source: Introduction to Mechanics, D.Kleppner and R.Kolenkow, Chapter 3, Exercise 3.5]
Here, in the solution, the momentum is conserved along the Y-direction by finding out the velocity at height h and then equating the momenta at highest point with it.
However, my doubt is that, momentum can be conserved only when there is no external force acting along that particular direction ; but then here, the weight acts downwards always, so how is momentum conserved?
Please help me understand where I'm going wrong.