Is it a bad practice to use break in a for loop? [closed]

No, break is the correct solution.

Adding a boolean variable makes the code harder to read and adds a potential source of errors.

Leave a Comment