I have 2d array (10x12), and they have 0 and 1s in them. I want to count the 1s in each array and I have two cases here: (1) if an array has more than three 1s, say k many, then generate k - 3 random variables and replace that many 1s with 0s if that random variable corresponds to a 1. (2)if an array has less than three 1s, say q many, then generate 3 - q random variables and replace that many 0s with 1s if that random variable corresponds to a 0. I have the following code so far. I need some suggestions here, I could not construct the code well.