Fix example that were using breaks

Some examples were using iterations and the break statement. Rewrote those to use the search method instead.