hey look...........
himanshu has done a fine job.......
but i m just adding something more.................
as U = Mgh
M= m/3.........
g= g..........
h= l/6..............( because we take effective height ..............
that is height of the centre of mass of the hanging part.........)
therefore...........
U= mgl/18.............ans
thanks...........
i know u have got the answer but just .........giving the information why himanshu has taken
l/6
hope u understands........