Google Kickstart Round C

why does brute force fail in this?
problem link

solution link: