the brute force "try-and-error" is a good technique because you will always get all of the possible answers. the only down side of this algorithm is that is has O(n^2) time complexity. in fact, no matter what algorithm you use, this problem cannot be solved in better than O(n^2) time.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.
you can also notice that either E is 0 or Y is 1 (since *** = E in the one's place).