I have the array:
$type = ['A','A','A','E','E','E','A','E','A','A','E','E'];
1 2 3 4 5
And I intend to count the number of elements A
that are included in consecutive chains with length more or equal 2. In the example I have three chains but i want count only two of them. Altogether result should be 5.