list = {
{0, 1, 1}, {0, 1, 1}, {0, 1, 1},
{0, 1, 1}, {0, 1, 1}, {0, 1, 1},
{0, 1, 1}, {1, 1, 0}, {1, 1, 0},
{1, 0, 1}, {1, 0, 1}, {1, 0, 1},
{1, 0, 1} ,{1, 0, 1},{1, 0, 1}
};
The list always has two 1s and one zero. I want to replace the 0s (position 1, 2 or 3 within element) that change to 1 in next element, with minus 1. This would give list2 below.
list2 = {
{0, 1, 1}, {0, 1, 1}, {0, 1, 1},
{0, 1, 1}, {0, 1, 1}, {0, 1, 1},
{**-1**, 1, 1}, {1, 1, 0}, {1, 1, **-1**},
{1, 0, 1}, {1, 0, 1}, {1, 0, 1},
{1, 0, 1} ,{1, 0, 1},{1, 0, 1}
};