How do I view solutions for a problem?

Grok will automatically show you the solution for any problem once you've solved it. We highly recommend taking a look at the sample solution, as you might see a simpler way of solving the problem or confirm that what you did was in fact the best way to do it!

Depending on the course type and your role (e.g. teachers) we will also in some cases make the solutions available earlier:

  • Some courses explicitly enable solutions at all times.
  • Competitions (e.g. Web.Comp, NCSS Challenge, Code Quest) will show solutions once the submission deadline has passed.
  • For Hour of Code courses, we show solutions after 5 days from your first attempt at the problem.
  • Pre-service teachers and tertiary educators will also see solutions 5 days after their first attempt.

Additionally, all verified teachers can see the teacher notes for all problems (see: Viewing teacher's notes), which will also contain the sample solution.

You can use the "Try this solution" link to copy the solution into your workspace. If you want to get your code back, you can click the "Load" button in the history view for the version you want to get back.

Still need help? Contact Us Contact Us