I spent the last couple of hours writing a Book class with methods that assign a title, find the most common words, break up pages, replace all instances of a word with another, etc. Ran into some issues with runtime since the input (a whole book) was rather large. Eventually improved runtime from n^2 to nlog(n), which made a big difference.
- Uses for class variables
- The basics of Regular Expressions
- Using Procs to avoid recalculations
See link to github file here.