I feel your method doesn't work, because - after some index, those count arrays information is no more valid.
Count arrays information is valid only from the beginning -- not from every index! -- With love and regards, Sairam Ravu I M.Tech(CS) Sri Sathya Sai Institute of Higher Learning "To live life, you must think it, measure it, experiment with it, dance it, paint it, draw it, and calculate it" --
