add a new algorithm: count array in 0 - n-1