I am trying to move the false element in 2d arraay to a different blank space in
ID: 3567790 • Letter: I
Question
I am trying to move the false element in 2d arraay to a different blank space in the array
x o _ x
_ _ o o
x x o _
The first and last element(x) in the first row are false because they do not have similer element around it. I want to move those false element to the empty space(_) in the array next to its similer element, to make it look something like this so they all the element are true(you can not move the true elemets, that already similer elements around, you just move the false elements near to its similer element)
for EX
_ o _ _
x x o o
x x o _
(you can move to any blank spot)
bytheway, the 2d array is called tissue, and i have the isSatiesfie method that checks if each element is true or false(does it have similer element around it) and i also have isArrSatiesfied that checks if the whole array is true or false(each element is has similar element around it)
Explanation / Answer
char[][] arr = new char[tissue.length][tissue[0].length]; int count = 0; char temp; for(int i=0; iRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.