I don't know about hideously inefficient... it is O(N).
I would agree that it is not the most elegant way to do it though, and my method does nothing for ties.
EDIT: Actually, now that I think about it, if I populate both arrays at the same time, then it becomes O(1). And I think that you are describing essentially the same thing that I am, only it appears that with your method, each time you check the count, you have to traverse the array where you stored your count...
Unless I am totally misunderstanding your angle of attack, in which case I am always open to a fresh perspective.