Code to perform Monte-Carlo simulation for Percoloation problem