> Do you have a dynamic programming solution which runs reasonably fast > in another language? Because this game of kyles looks like an example > from combinatoric game theory to me and as such it might be much more > efficient to solve it using nim-sums (if possible; I haven't given this > too much thought). > > Also note that, since your strings only consist of X and I, you could > also use Integers and bit-operations instead of lists in your > algorithms. You'd still need a Map for memoization, but other operations > might be much faster. > > Cheers