Joined
·
409 Posts
Well I am almost done with an very simple program I wrote for my Programming 1 class however I am completely at a wall when it comes to this step. After the user inputs a string(got that part
) I need to make it so the user gets an option to 'decipher' the string, sorting the occurrence of every letter in descending order. For example if the string is "aa bbb c" the output is "B ,A , C".
I havent the slightest on how to approach this. So far I was able to store the occurrence of each letter in an integer array count[0-25], and can sort it using array.sort, however I think that is a deadend for I don't know how to distinguish for example count[2](this will be C) with count[0] (A) for they are just numbers.

I havent the slightest on how to approach this. So far I was able to store the occurrence of each letter in an integer array count[0-25], and can sort it using array.sort, however I think that is a deadend for I don't know how to distinguish for example count[2](this will be C) with count[0] (A) for they are just numbers.