How do I solve this problem without a continuous loop

Printable View