To find a solution of score n < L, take my optimal solution, and flip the first (L - n) matching letters. To find them all ... I'm not sure that's interesting, it's just a matter for recursive programming. The objective for me was to find the optimal solution in linear time, which is why I expressed it as a type 3 grammar.
no subject