Error in lesson



I have perceived an error in the lesson. The solution presented as correct contains the following flaw:
you are asked to update:
when in fact it should be:

the -1 is needed to correct for the indexes starting at 0 instead of 1. Otherwise, when giving input 1st row 1st column, it will update 2nd row 2nd column and 5th row gives an out of range exception.

Just a little detail i've encountered, hope it helps some people understand their errors. :smile:

great course btw.


Your expectation is that the user should enter numbers 1-5, but that could just as well be 0-4, it's arbitrary either way. The exercise isn't incorrect, it's different from your expectation.

If you want the user to use 1-5, then I suggest modifying what the user enters to keep the rest of your code consistent as opposed to having two kinds of indexing (1-based and 0-based)