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 to help aid in your problem solving abilities and to see another approach to complete the problem! (Sometimes an even better approach!)

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) 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