I'm implementing the longest common subsequence for n dimensions. Current problem: how do I traverse the n strings? Simply nesting for
loops won't work anymore, because I need n of them. What's the nice solution for that problem? Loops + recursion, I suppose, but how exactly? I'm not asking for the complete algorithm, but only how to generate all combinations for the dynamic programming algorithm.
Example in 2D:
for position, char in word0:
for position1, char1 in word1:
# code here