Nothing too smart about this solution, problem wasn't big enough to need anything more than brute force.
I first loaded the entire names.txt file into a string, then tokenized it (using strtok) into each individual word. Each word was stored in a "Node", all of which are stored in a sorted linked list. Finally I run through the linked list and add up all the scores and display it.
Run time: 0.448 seconds
PE022_c
Return to list of solutions
Comments (0)
You don't have permission to comment on this page.