Equal numbers in sub-array Given an array of numbers with length &gt;=3 and length % 3 == 0

[1, 2, 3, 4, ...] 

You will split it in sub-arrays of length 3

[[1, 2, 3], [4, 5, ...], [... 

And return an array with


[0] => The amount of cases in the sub-array where all numbers are equal
[1] => In case all numbers in sub-array are not equal, the amount of cases in the sub-array where only 2 numbers are equal


Example and test cases:


Input: [2, 4, 2, 5, 5, 5, 4, 2, 1, 3, 3, 1] output [1, 2]


This is because 

[[2, 4, 2], [5, 5, 5], [4, 2, 1], [3, 3, 1]]
  ^     ^    ^  ^  ^               ^  ^ 
   equal    all equal              equal   


so 2 equal and 1 all equal


[3,5,6,5,5,7,6,6,8,7,7,7,3,4,2,4,4,3]     =&gt; [1, 3]
[3,3,3,4,4,4,5,5,5,6,6,6,5,4,3]           =&gt; [4, 0]
[3,4,5,6,7,8,9,8,7,6,5,4,3,2,1]           =&gt; [0, 0]




This is code-golf, so the shortest answer in bytes win.



PD: Apologies for my English.
Octave, 60 52 50 bytes



@(x)sum(sum(~diff(sort(reshape(x,3,[]))))'==[2 1])


Try it online!

Saved 8 bytes thanks to Luis!

Explanation:

Reshapes the input into a matrix with 3 rows, and the appropriate amount of columns. It then sorts each of the columns, and calculates the difference between the elements on different rows. This gives a matrix with two rows, where identical numbers will have a zero, and different numbers will have a positive number. This is negated, so that all equal elements are 1, and all unequal are 0. We then sum each of those columns, giving us one of the three alternatives: 0 = All elements are unequal, 1 = Two elements are equal and 2 = All elements are equal. We then check how many are &gt;1, and how many are exactly ==1.