Read up on the Boyer-Moore string search algorithm on wikipedia, which determines the index of the first occurence of a substring within a string: http://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string_search_algorithm Then try to design an implementation of it using TDD. How do you make sure the implementation uses that specific algorithm when the algorithms interface (two strings input, one integer output) is so simple? |