it checks the given solution