[Newbies] Collection in Smalltalk
Yoshiki Ohshima
yoshiki at vpri.org
Wed Sep 24 23:17:18 UTC 2008
At Wed, 24 Sep 2008 22:39:53 +0100,
Marcin Tustin wrote:
>
> Write a method that tells you score of a character
Yes.
> Write a method that tells you the score of a string (hint: use inject:into:)
Yes.
> Write a method that tells you the dollar words (hint: use select: and splitOn:)
This part is not really a Smalltalk question, I think. It is a
problem of searching in a power set and finding the all solutions. It
is not exactly a simple task, because the length of string may be
fairly big, You would need to do some dynamic programming to pick 100
a's from a 10,000 characters string.
http://en.wikipedia.org/wiki/Dynamic_programming
-- Yoshiki
More information about the Beginners
mailing list