Monte Carlo solution for a lattice of coupled superconducting grains