Use Hashtable
Convert the input value and the occurrence as Integer, use input value as Key and occurrence as Value, for every input, if you can find in the hashtable, increase the occurrence, if not, just put it in. The rest should be very easy.
本帖共有 7 楼,当前显示第 7 楼,本文还有 N-1 层楼,要不你试试看:点击此处阅读更多 >>