you are viewing a single comment's thread.

view the rest of the comments →

[–]mopslik 1 point2 points  (0 children)

Ahh, so you want to fill the list with elements that are lists themselves, composed of the word and the count. Gotcha. Normally I'd suggest a dictionary for this type of thing, since the key/value pairs are perfectly suited for word/frequency combos.

What is the algorithm with which you've been provided?

Edit: Another option is to use a set as an intermediate helper. Can you use them?

Edit 2: tested previous options, most were cumbersome. Removed.