Translation:The judge says that it is not legal.
While the meaning communicated would be the same, I do not think this is correct in a translation exercise. These exercises test whether learners understand grammar (here, how to structure negation), vocabulary etc. and can follow the given sentences. In a real life situation, you can use whichever option comes more easily to you, but within Duolingo it's best to stick to the original as much as possible.