As there can be only 3 remainders
Stack < int > ones = new Stack < int > ( ) ; Stack < int > zeros = new Stack < int > ( ) ; Stack < int > twos = new Stack < int > ( ) ; c_0 = 0 ; c_1 = 0 ; c_2 = 0 ; count_k ( arr , ones , twos , zeros ) ;