| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

PE022

Page history last edited by Kenneth Finnegan 15 years, 8 months ago

Project Euler Problem #22

 

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.