def solve(header, sol):
    if header.R == header:     # instance vide, solution trouvée
        return True
    c = None                   # chercher colonne la moins couverte
    j = header.R
    while j != header:
        if c is None or c.S < j.S:
            c = j
        j = j.R
    cover(c)                   # couvrir cette colonne
    r = c.D                    # essayer chaque ligne
    while r != c:
        sol.append(r.S)
        j = r.R                # couvrir éléments dans l'ensemble r
        while j != r:
            cover(j.C)
            j = j.R
        if solve(header, sol):
            return True
        j = r.L                # restituer
        while j != r:
            uncover(j.C)
            j = j.L
        sol.pop()
        r = r.D
    uncover(c)
    return False
# snip}
dataset/ETHPy150Open jilljenn/tryalgo/tryalgo/dancing_links.py/solve/swapped operands of `<`