in reply to Re^2: True Brute Force Longest Common Sub Sequence
in thread True Brute Force Longest Common Sub Sequence

Hrm. I wouldn't call that a sequence, but ok. You problem is still a function of length and nothing more.

It's the sum of 2 ^ (remaining length), from 1 to length. Since we can have any character on or off (essentially).

So you have something length 5, for example. That'd be 1 * 2^0 + 2 * 2 ^1 + 3 * 2^2 + 4 * 2 ^ 3 + 5 * 2 ^4. Just looking at that sequence should give you a good idea of how to right a loop around it.

--
I used to drive a Heisenbergmobile, but every time I looked at the speedometer, I got lost.