O(n) The elemIndices function extends elemIndex,
by returning the indices of all elements equal to the query element,
in ascending order. This implementation uses memchr(3).
O(n) The elemIndices function extends elemIndex,
by returning the indices of all elements equal to the query element,
in ascending order. This implementation uses memchr(3).
The elemIndices function extends elemIndex, by returning
the indices of all elements equal to the query element, in ascending
order.
Beware: elemIndicesxxs will diverge
if any suffix of xs does not contain x.