Stuck on SEAGRP problem


i am trying to solve the SEAGRP problem by using the Tutte matrix approach.
I get WA all the time and cannot really find the problem in my code.

My code looks as follows:

Any suggestions would be appreciated.

Here’s my code with comments-
What i could not understand was basically how the gaussian elimination was working and so i commented that particularly!

Hope it helps!
Other resources to help understanding-
Tutte Matrix-Wikipedia
Gaussian Elimination- Wikipedia