What about using a string?
If the input is ascii characters and the max occurrance of each letter is 94 you could store the count as a single ascii character and which letter it was as the index into the string. Then the whole thing is just string operations.
For example:
if a count of 0 is stored as a space. a count of 1 is stored as a !, a count of 33 is stored as an A. a count of 65 is stored as an a, a count of 94 is stored as a ~, etc (the ascii code minus 32)
And if the first character in the string represents the number of spaces and the second represents the number of ! and the 33rd character represents the number of A, and the 94th character represents the number of ~, etc (the ascii code minus 32)
Then an input of "a" would look have 93 spaces except the 65th character which could be encoded as ! to mean 1. And an input of "aabbab" would be all spaces except the 65th and 66th character which would be a # to mean 3.
Of course, if the max number of occurance is larger than 94 or they won't be ascii characters then this won't work. You could get around this by using two or more characters to represent each count but that quickly gets silly.
I didn't say it was a good idea and I would kill anyone that wrote real code like that but for a thought experiment where the goal is explicitely "look for another solution." then this fits that criteria.
Jerry