I want to create a brute force algorithm to find the largest common subsequence between 2 strings, but I'm struggling to enumerate all possibilities in the form of a algorithm.
I don't want a dynamic programming answer as oddly enough I manage to figure this one out (You would think the brute force method would be easier). Please use pseudo code, as I prefer to understand it and write it up myself.
It's pretty much the same as DP minus the memoization part.
The idea is if we have two strings s1 and s2 where s1 ends at i and s2 ends at j, then the LCS is:
The time complexity is obviously exponential.