I am trying to learn python and get good at algorithms. This is my first language.
for example: take “baggage” and sort into “aabeggg”
string = "baggage"
count = [0] * len(string)
for x in string:
num_value = ord(x)
count[num_value] += 1
I think the above is a start…but I’m not really sort how to go about it.
collections.Counteris a great way to solve this, but here is a way to get you a bit further in the direction you are heading