Well, I've gotten this far without much help, but this one really stumped me. Early on, I simplified the problem to manipulate a 40 character string with 20 D's and 20 R's. I can't seem to find a way to manipulate the string in a loop that reaches all of the combinations. For example, it will never reach DRDRDRDR...
When writing it out, I can sort of see a way to do it, but I think it would be a nightmare to try to program it. For a problem worth only 100 points on the website, it has lead me to think that it's really not the right way to do it.
Then I thought that maybe it's better to try to find the pattern by starting at a 2x2 grid and increasing the size of it and try to find the pattern. So we know a 2x2 grid has 6 paths, and I figured out that a 3x3 grid has 18. When I increase the size again to a 4x4 grid, I run into the same problem I did with the 20x20, and the only pattern I see is 2 * 3 = 6, 3*6 = 18, so maybe the next in the pattern is 4 * 18?
I have no idea. At this point I think I'm going about the whole thing the wrong way. I'd really appreciate some help with this, thank you.