A solid cube of side $2a$ and mass $M$ (moment of inertia for a cube of side $s$ about its center of mass is $I=1/6 Ms^2$) is sliding on a frictionless surface with constant velocity. It hits a small obstacle (inelastic collision) at the end of the table that causes the cube to tilt over as shown. Show that the minimum speed that the cube needs to tip over and fall of the table is: (Hint: you’ll need to use energy here)
For minimum initial velocity, the cube should have zero velocity when it is just about to tip over. So, the initial kinetic energy must be completely converted into potential energy. Initially, the cube's center of mass is at a height $a$ (measured from the top of the table). The length of a diagonal of a side of the cube is $2\sqrt 2a$. So, when the cube is about to tip over, the center of mass is at a height of $\sqrt 2a$.
This is not the answer given, so my approach is obviously wrong. Can someone tell me how to solve this problem?