Here is my example data structure:
r stands for row.
var data = {
r0: ["E9", "55", "1C"],
r1: ["1C", "E9", "E9"],
r2: ["BD", "1C", "55"]
}
How would I go about finding all of the paths where paths cannot be the same, paths can only traverse starting horizontally (and only starting in row 0), then vertically, then horizontally, etc., during a path it cannot pick the same value. Paths can "jump" values though, if a valid value is detected in the current row/column.
Rows and columns start at index 0.
Examples of expected paths output from future algorithm:
RowColumn(value),....
// these paths stop because there are no more valid vertical or horizontal values to pick.
00(E9), 10(1C), 11(E9), 01(55), 02(1C), 22(55), 12(E9)
02(1C), 22(55), 20(BD), 00(E9), 01(55), 21(1C), 11(E9), 10(1C), 12(E9)