The solution of the Algorithm : Longest Nap