Magic square on system verilog

In reply to sam33rs:

I see syntax errors with this code.
Is it working for you?

a.sum() with (item.index(1)==0 ? item : 0) == 15;//row0

Error - This type is illegal in this context [SystemVerilog].

Regards,
Naveen