• numpy alternative?

Question related to mission How Much Gold

 

With numpy this one would be short, but it is not allowed. Do I really have to reinvent the wheel and implement matrix inversion from scratch? Any advice would be greatly appreciated :)