Break and Continue exercise

solution without having to use break and continue