Perfectly elastic collision between two objects Two objects with masses m1=3kg and m2=1kg are attached at the end weightless rope of length l=0.8m as showing below:

The 2 objects "collide" with perfect elastic collision.I found that the velocity of m2 is v2=6m/s after the collision, applying the law of conservation of momentum. I tried to find the max height that m2 can reach after the collision, applying the law of conservation of total energy (Kinetic+Dynamic at start=Kinetic+Dynamic at the end) and i found the height equal to 1.8m which is larger than 1.6m(2*l).What have i done wrong?
 A: I did not check your calculations, but maybe you did not take into account that $m_2$ can have nonzero speed at the top of its trajectory (where the height is 1.6 m).
A: You didn't do anything wrong, you just solved a different problem. You solved the problem where mass $m_2$ is free after the impact to rise to any height. As if it was released on a ramp after impact.
And indeed for this other problem, the maximum height that can be achieved is
$$ h = \left( \tfrac{m_1}{m_1+m_2} \right)^2 4 \ell $$
This means that when $m_1 > (\sqrt{2}-1) m_2$, then the resulting height is $h> 2 \ell$.
But this problem requires an understanding of its kinematics. That is the study of all available motions. Because the masses are attached to rods, and can only move in arcs, describing their position using a height variable $h$ is a problematic choice because $h$ is constrained to be in an arc.
If you use the angle the mass makes from vertical $\theta_2$ instead, then you can ascribe the horizontal velocity after impact to a rotational speed of $$ \omega_2 = \frac{v_2}{\ell}$$
The difference here is that kinetic energy isn't $KE = \tfrac{1}{2} m_2 v^2$ anymore, but rather
$$ KE = \tfrac{1}{2} m_2 \ell^2 \omega_2^2 $$
and potential energy depends on the height $h = L (1- \cos \theta_2)$ still
$$ PE = m_2 g L (1- \cos \theta_2)$$
If you combine it all together, you will find at the top of the swing, when $\theta_2 = \pi$, that the rotational speed is
$$\omega_2 = \sqrt{ \frac{v_2^2}{\ell^2} - \frac{4 g}{\ell} } $$
Since the part inside the square root cannot be negative, it means that when $v_2 > 2 \sqrt{\ell g}$ the system will still have a velocity at the top of the swing. This is consistent with the result from above since $v_2$ depends on the ratio of masses.
I can go a step further and describe the maximum angle achievable as
$$ \cos \theta_2 = 1 - \frac{v_2^2}{2 g \ell } = 1 - 4 \left( \tfrac{m_1}{m_1+m_2} \right)^2 $$
In summary, physics is about understanding the assumptions and limitations of the concepts and formulas you learn and you correctly identified an unreasonable result which raised a flag with you.
Unfortunately, you hadn't been introduced to the concept of kinematics (other than parabolic motions) I suppose. I am a big proponent of teaching kinematics in high school, as it bridges the gap between geometry and physics.
Initially, I thought the question was off of topic here, but I think indeed it is totally on topic because it requires an understanding of concepts that might not be familiar to you.
