Absence of Non-conservative forces
Non-conservative forces such as friction and air drag are not mentioned in the problem. It is assumed that non-conservative forces are absent in the given problem. Hence, conservation of mechanical energy can be applied. That is, the total initial energy will be equal to the total final energy of the system.