Need help with a problem.
Can someone please give me a solution and a PROOF of the algorithm for this problem?....Link :