Brute force optimization example