Number Chaining Predicate

Python 2, 48 bytes

lambda x:reduce(lambda a,b:set(a)&set(b)and b,x)

Try it online!

Print a empty set for False and the last element for True


Retina, 25 20 bytes

(.).*¶(?=.*\1)

^.+$

Try it online!

Whenever we find a digit that also occurs in the next number, we remove the separator between those numbers (along with the digits in the former number, starting from the shared one, but that's irrelevant). The input is valid, if all separators have been remove in the process, which we check by making sure that the string can be matched as a single line.


Brachylog, 9 bytes

{⊇ᵐ=∧?t}ˡ

Try it online!

Note that this not only works with a list of integers, but also with a list of strings or a list of lists.

Explanation

{      }ˡ       Left fold on the input:
 ⊇ᵐ=              It is possible to find a number which is a subset of both input numbers
    ∧             (and)
     ?t           The output is the second number (to continue the fold)

Tags:

Code Golf