It is sad when FGITW extremely-brute-force "answers" like this get accepted, esp. when there are much better insightful answers. Is there anything more we can do besides downvote them? @Jyrki
@BillDubuque I agree. Not sure we can do much else. There's no mechanism forcing (or even nudging) such users to join in a round table discussion as to what is expected., and what others find problematic in their conduct.
Mind you, in my youth I had to handle a very similar question (if not exactly the same). At that time I didn't know about field extensions, so I had to do without. I posted a CW answer explaining the basic ideas reducing the amount of checking by a factor of ten from Mohammad's answer. Further reductions are undoubtedly possible.