Problem 1:
if you flip element five you 3210 reading left to right and 0123 reading right to left. Of course, if you are only allowed to read left to right, then it's a moot point.

Problem 2:
If the final number of elements doesn't allow backtracking then the path 00, 10, 20, 30, 20, 21, 22, 23, 33 isn't valid, correct? Presumably, you can backtrack internally, but not backtracking to make a longer path.

This boils down to solving a maze with optimazation of points accumulated and maximum path length. If you've not written a maze solving program here's your chance. Briefly you need some way to keep track of where you are and where you've been. As indicated previously, this can be done using recursion or stacks. Define the board as a multidimensional array of type cell where cell is declared as a user defined type containing an int to indicate which row the cell in, an int to represent which column the cell is in, and an int value representing the 0, 2, 4, -1, etc. Have some way to determine whether a given cell has another cell to the right or down or not, either intrinsic to the cells declaration or outside the cell declaration in a validation function.

Here's a rough algorhythm using stacks that I think will work if you want to go that way. Start by pushing the cell at 00 it on the stack. Always look in one direction first (either right or down), say down. So look down from 00 at cell 10. 10 is not the end and is a valid move so push it on the stack and keep going down 'til the stack includes 00, 10, 20, 30 since they are all valid moves. Then since there isn't a 40 look to the right of 30 at 31, which is a -1. This means that 30 has no down and right is invalid, so 30 is a dead end, so pop 30 from the stack. Now look right (you've already looked down from here since it's already on the stack) from the cell at the top of the stack, that is, look at 21 from 20. 21 is not the end and is valid so keep pushing cells on the stack until you get to 23 (31 and 32 aren't the end and aren't valid when you look down from 21 and 22 so they aren't added to the stack although 21 and 22 are added to the stack going from 20 to 23). Looking down from 23 is 33, which is the end, so you now have a valid path. Determine the length, value, and cells in the path and store the values somewhere for later comparison with any other valid paths. Then pop 33 from the stack and rexamine all the remaining paths by examining any down or right options left in the top cell of the stack and popping any cell that has had both right and down looked at already or are invalid. In essence in this scenario after each push you look down from the cell at the top of the stack and after each pop you look right from the cell at the top of the stack.