Write an algorithm for this problem (Simple)

Printable View