Background
Flow Free is a series of puzzle games whose objective is to connect all the same-colored pairs of dots on the grid. In this challenge, we consider the original game on a rectangular grid (no variations like bridges, warps, or hexagonal grids).
A puzzle in Flow Free might look like this:
Puzzle Solution
....1 11111
..... 13333
..24. 13243
1.... 13243
23... 23243
...43 22243
One of the easiest techniques in the puzzle is that, if you can connect two dots by following the "border cells" in only one way, such a connection is always correct.
Border cells are unsolved cells that are (orthogonally or diagonally) adjacent to a solved cell (including those outside of the grid).
In order to use this technique, the two dots themselves must also be border cells, and two adjacent border cells can be connected only if they're adjacent to some common solved cell. See the explanation below for an illustration.
A puzzle is said to be "trivial" if this technique can be used from the start to the end.
The above example is an example of a trivial puzzle. Let's see how it is so.
Puzzle Border Trivial pair
....1 ##### 11111
..... #...# 1...#
..24. #...# 1...#
1.... #...# 1...#
23... #...# #...#
...43 ##### #####
.... #### 3333
.24. #..# 3..3
.... #..# 3..3
23... ##..# #3..3
...43 ##### ####3
24 ## 24
.. ## 24
2 .. # ## 2 24
...4 #### 2224
Note that, in the last step, the following paths are not considered because a horizontal connection in the middle of the width-2 strip is not valid ("two adjacent border cells can be connected only if they're adjacent to some common solved cell"):
2. .4
22 44
2 22 . 4.
222. ..44
Challenge
Given a solved Flow Free puzzle, determine if it is trivial.
The input can be taken as a single string/array or a list of lines. You may assume only the digits 1-9 are used, and each line represented by each digit is a valid polystrip of length 3 or higher.
For output, you can choose to
- output truthy/falsy using your language's convention (swapping is allowed), or
- use two distinct, fixed values to represent true (affirmative) or false (negative) respectively.
Standard code-golf rules apply. The shortest code in bytes wins.
Test cases
Truthy (is trivial)
11111
12221
11113
33333
32222
11111
13333
13243
13243
23243
22243
Falsy (is not trivial)
m90 provided the last test case, which is specifically constructed to use an invalid bridge (the line 5).
11121
13121
13121
13111
11122
13121
13121
33111
13333
13443
13343
11243
21243
22244
1116777
1226666
1125555
5555344
8888334
9998444
????? 13?31 ?242? ?????? ?4??? ?????
trivial? How can I trivially know 1 is connected use upper half border other than the another part? \$\endgroup\$??2???2 ????1?1
is trivial but2?????2 ????1?1
is not. And2222222 2222111
is ambiguous? \$\endgroup\$1
s in the example? \$\endgroup\$