Hint. Apply conservation of mechanical energy to the system consisting of the two blocks, the pulley, the string, and the earth. The mechanical energy at the initial instant when the blocks start moving is equal to the final mechanical energy when block 2 has elevation hf. The final mechanical energy involves the final speed vf via the kinetic energies of the two blocks at that instant. Thus, energy conservation yields an equation for vf that can be solved.