My own coding for Week_2 back substitution

I find a simple solution for the back substitution part. Can I substitute it for the adviced code matrix?

The grader does not actually examine your source code: it only calls your function with test parameters and checks the output. So it only matters that your solution is correct, even if you don’t structure it the same way the comments in the template code suggest.

But I think this is probably a duplicate thread and you later found that the grader did not accept your code. I have already answered you on that thread.

I get the following fault: There was an error grading your submission. Details:
shapes (1,) and (0,) not aligned: 1 (dim 0) != 0 (dim 0)

My solution seems to calculate false. Where is the error:

{moderator edit - solution code removed}

Your mistake is that you are not covering the last element in the rows in your reduction. That is the “augmented” value. Think about what happens when you do this with pencil and paper: you need to handle the augmented column as well, right? Those reduced values are what will eventually give you the solution.

Check your results on one of the test cases and I’ll bet that you just return the original values from the last column.

Also BTW we’re not supposed to just post solution code in public here. There is no harm done, since I can edit the post to remove the code. But the better way is just to show us the output you get including error traces. If we can’t figure out what is happening from that, there are private ways to share source code.

Thanks for your efforts. I have fixed the problem now.