broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        left,right,start,length=d
        a=[v for chunk in left for v in chunk]
        b=[v for chunk in right for v in chunk]
        rows=[[a[i],b[i]] for i in range(len(a))]
        rows=rows[start:start+length]
        return [row for i,row in enumerate(rows) if row not in rows[:i]]
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('different boundaries', solve([[[1, 2], [3]], [[4], [5, 6]], 0, 3]), [[1, 4], [2, 5], [3, 6]])
    check('empty internal chunks', solve([[[1], [], [2]], [[], [3, 4]], 0, 2]), [[1, 3], [2, 4]])
    check('global slice', solve([[[1], [2, 3]], [[4, 5], [6]], 1, 2]), [[2, 5], [3, 6]])
    check('null field', solve([[[None, 1]], [[2, None]], 0, 2]), [[None, 2], [1, None]])
    check('repeated rows', solve([[[1, 1]], [[2, 2]], 0, 2]), [[1, 2], [1, 2]])
    check('zero length', solve([[[1]], [[2]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 2:
    check('different boundaries', solve([[[2, 3], [4]], [[5], [6, 7]], 0, 3]), [[2, 5], [3, 6], [4, 7]])
    check('empty internal chunks', solve([[[2], [], [3]], [[], [4, 5]], 0, 2]), [[2, 4], [3, 5]])
    check('global slice', solve([[[2], [3, 4]], [[5, 6], [7]], 1, 2]), [[3, 6], [4, 7]])
    check('null field', solve([[[None, 2]], [[3, None]], 0, 2]), [[None, 3], [2, None]])
    check('repeated rows', solve([[[2, 2]], [[3, 3]], 0, 2]), [[2, 3], [2, 3]])
    check('zero length', solve([[[2]], [[3]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 3:
    check('different boundaries', solve([[[3, 4], [5]], [[6], [7, 8]], 0, 3]), [[3, 6], [4, 7], [5, 8]])
    check('empty internal chunks', solve([[[3], [], [4]], [[], [5, 6]], 0, 2]), [[3, 5], [4, 6]])
    check('global slice', solve([[[3], [4, 5]], [[6, 7], [8]], 1, 2]), [[4, 7], [5, 8]])
    check('null field', solve([[[None, 3]], [[4, None]], 0, 2]), [[None, 4], [3, None]])
    check('repeated rows', solve([[[3, 3]], [[4, 4]], 0, 2]), [[3, 4], [3, 4]])
    check('zero length', solve([[[3]], [[4]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 4:
    check('different boundaries', solve([[[4, 5], [6]], [[7], [8, 9]], 0, 3]), [[4, 7], [5, 8], [6, 9]])
    check('empty internal chunks', solve([[[4], [], [5]], [[], [6, 7]], 0, 2]), [[4, 6], [5, 7]])
    check('global slice', solve([[[4], [5, 6]], [[7, 8], [9]], 1, 2]), [[5, 8], [6, 9]])
    check('null field', solve([[[None, 4]], [[5, None]], 0, 2]), [[None, 5], [4, None]])
    check('repeated rows', solve([[[4, 4]], [[5, 5]], 0, 2]), [[4, 5], [4, 5]])
    check('zero length', solve([[[4]], [[5]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 5:
    check('different boundaries', solve([[[5, 6], [7]], [[8], [9, 10]], 0, 3]), [[5, 8], [6, 9], [7, 10]])
    check('empty internal chunks', solve([[[5], [], [6]], [[], [7, 8]], 0, 2]), [[5, 7], [6, 8]])
    check('global slice', solve([[[5], [6, 7]], [[8, 9], [10]], 1, 2]), [[6, 9], [7, 10]])
    check('null field', solve([[[None, 5]], [[6, None]], 0, 2]), [[None, 6], [5, None]])
    check('repeated rows', solve([[[5, 5]], [[6, 6]], 0, 2]), [[5, 6], [5, 6]])
    check('zero length', solve([[[5]], [[6]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        left,right,start,length=d
        a=[v for chunk in left for v in chunk]
        b=[v for chunk in right for v in chunk]
        rows=[[a[i],b[i]] for i in range(len(a))]
        rows=rows[start:start+length]
        return [row for i,row in enumerate(rows) if i==0 or row!=rows[i-1]]
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('different boundaries', solve([[[1, 2], [3]], [[4], [5, 6]], 0, 3]), [[1, 4], [2, 5], [3, 6]])
    check('empty internal chunks', solve([[[1], [], [2]], [[], [3, 4]], 0, 2]), [[1, 3], [2, 4]])
    check('global slice', solve([[[1], [2, 3]], [[4, 5], [6]], 1, 2]), [[2, 5], [3, 6]])
    check('null field', solve([[[None, 1]], [[2, None]], 0, 2]), [[None, 2], [1, None]])
    check('repeated rows', solve([[[1, 1]], [[2, 2]], 0, 2]), [[1, 2], [1, 2]])
    check('zero length', solve([[[1]], [[2]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 2:
    check('different boundaries', solve([[[2, 3], [4]], [[5], [6, 7]], 0, 3]), [[2, 5], [3, 6], [4, 7]])
    check('empty internal chunks', solve([[[2], [], [3]], [[], [4, 5]], 0, 2]), [[2, 4], [3, 5]])
    check('global slice', solve([[[2], [3, 4]], [[5, 6], [7]], 1, 2]), [[3, 6], [4, 7]])
    check('null field', solve([[[None, 2]], [[3, None]], 0, 2]), [[None, 3], [2, None]])
    check('repeated rows', solve([[[2, 2]], [[3, 3]], 0, 2]), [[2, 3], [2, 3]])
    check('zero length', solve([[[2]], [[3]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 3:
    check('different boundaries', solve([[[3, 4], [5]], [[6], [7, 8]], 0, 3]), [[3, 6], [4, 7], [5, 8]])
    check('empty internal chunks', solve([[[3], [], [4]], [[], [5, 6]], 0, 2]), [[3, 5], [4, 6]])
    check('global slice', solve([[[3], [4, 5]], [[6, 7], [8]], 1, 2]), [[4, 7], [5, 8]])
    check('null field', solve([[[None, 3]], [[4, None]], 0, 2]), [[None, 4], [3, None]])
    check('repeated rows', solve([[[3, 3]], [[4, 4]], 0, 2]), [[3, 4], [3, 4]])
    check('zero length', solve([[[3]], [[4]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 4:
    check('different boundaries', solve([[[4, 5], [6]], [[7], [8, 9]], 0, 3]), [[4, 7], [5, 8], [6, 9]])
    check('empty internal chunks', solve([[[4], [], [5]], [[], [6, 7]], 0, 2]), [[4, 6], [5, 7]])
    check('global slice', solve([[[4], [5, 6]], [[7, 8], [9]], 1, 2]), [[5, 8], [6, 9]])
    check('null field', solve([[[None, 4]], [[5, None]], 0, 2]), [[None, 5], [4, None]])
    check('repeated rows', solve([[[4, 4]], [[5, 5]], 0, 2]), [[4, 5], [4, 5]])
    check('zero length', solve([[[4]], [[5]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 5:
    check('different boundaries', solve([[[5, 6], [7]], [[8], [9, 10]], 0, 3]), [[5, 8], [6, 9], [7, 10]])
    check('empty internal chunks', solve([[[5], [], [6]], [[], [7, 8]], 0, 2]), [[5, 7], [6, 8]])
    check('global slice', solve([[[5], [6, 7]], [[8, 9], [10]], 1, 2]), [[6, 9], [7, 10]])
    check('null field', solve([[[None, 5]], [[6, None]], 0, 2]), [[None, 6], [5, None]])
    check('repeated rows', solve([[[5, 5]], [[6, 6]], 0, 2]), [[5, 6], [5, 6]])
    check('zero length', solve([[[5]], [[6]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Chunk assembly treats repeated physical rows as duplicates.

Assemble two equally long logical columns from independent chunk layouts. Empty chunks carry no rows. Zip by global row ordinal, retain null values, and apply the requested half-open row slice after alignment.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,values in d:
            if values is None:
                continue
            if not values:
                out.append([ident,None,None]); continue
            for pos,value in enumerate(values):
                out.append([ident,pos,value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('ordered parents', solve([[3, [1, 2]], [1, [4]]]), [[3, 0, 1], [3, 1, 2], [1, 0, 4]])
    check('null parent', solve([[1, None]]), [[1, None, None]])
    check('empty parent', solve([[1, []]]), [[1, None, None]])
    check('null element', solve([[1, [None, 2]]]), [[1, 0, None], [1, 1, 2]])
    check('duplicate element', solve([[1, [2, 2]]]), [[1, 0, 2], [1, 1, 2]])
    check('empty input', solve([]), [])
    check('singleton', solve([[5, [1]]]), [[5, 0, 1]])
elif N == 2:
    check('ordered parents', solve([[4, [2, 3]], [2, [5]]]), [[4, 0, 2], [4, 1, 3], [2, 0, 5]])
    check('null parent', solve([[2, None]]), [[2, None, None]])
    check('empty parent', solve([[2, []]]), [[2, None, None]])
    check('null element', solve([[2, [None, 3]]]), [[2, 0, None], [2, 1, 3]])
    check('duplicate element', solve([[2, [3, 3]]]), [[2, 0, 3], [2, 1, 3]])
    check('empty input', solve([]), [])
    check('singleton', solve([[6, [2]]]), [[6, 0, 2]])
elif N == 3:
    check('ordered parents', solve([[5, [3, 4]], [3, [6]]]), [[5, 0, 3], [5, 1, 4], [3, 0, 6]])
    check('null parent', solve([[3, None]]), [[3, None, None]])
    check('empty parent', solve([[3, []]]), [[3, None, None]])
    check('null element', solve([[3, [None, 4]]]), [[3, 0, None], [3, 1, 4]])
    check('duplicate element', solve([[3, [4, 4]]]), [[3, 0, 4], [3, 1, 4]])
    check('empty input', solve([]), [])
    check('singleton', solve([[7, [3]]]), [[7, 0, 3]])
elif N == 4:
    check('ordered parents', solve([[6, [4, 5]], [4, [7]]]), [[6, 0, 4], [6, 1, 5], [4, 0, 7]])
    check('null parent', solve([[4, None]]), [[4, None, None]])
    check('empty parent', solve([[4, []]]), [[4, None, None]])
    check('null element', solve([[4, [None, 5]]]), [[4, 0, None], [4, 1, 5]])
    check('duplicate element', solve([[4, [5, 5]]]), [[4, 0, 5], [4, 1, 5]])
    check('empty input', solve([]), [])
    check('singleton', solve([[8, [4]]]), [[8, 0, 4]])
elif N == 5:
    check('ordered parents', solve([[7, [5, 6]], [5, [8]]]), [[7, 0, 5], [7, 1, 6], [5, 0, 8]])
    check('null parent', solve([[5, None]]), [[5, None, None]])
    check('empty parent', solve([[5, []]]), [[5, None, None]])
    check('null element', solve([[5, [None, 6]]]), [[5, 0, None], [5, 1, 6]])
    check('duplicate element', solve([[5, [6, 6]]]), [[5, 0, 6], [5, 1, 6]])
    check('empty input', solve([]), [])
    check('singleton', solve([[9, [5]]]), [[9, 0, 5]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,values in d:
            if values is None:
                out.append([ident,0,None]); continue
            if not values:
                out.append([ident,None,None]); continue
            for pos,value in enumerate(values):
                out.append([ident,pos,value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('ordered parents', solve([[3, [1, 2]], [1, [4]]]), [[3, 0, 1], [3, 1, 2], [1, 0, 4]])
    check('null parent', solve([[1, None]]), [[1, None, None]])
    check('empty parent', solve([[1, []]]), [[1, None, None]])
    check('null element', solve([[1, [None, 2]]]), [[1, 0, None], [1, 1, 2]])
    check('duplicate element', solve([[1, [2, 2]]]), [[1, 0, 2], [1, 1, 2]])
    check('empty input', solve([]), [])
    check('singleton', solve([[5, [1]]]), [[5, 0, 1]])
elif N == 2:
    check('ordered parents', solve([[4, [2, 3]], [2, [5]]]), [[4, 0, 2], [4, 1, 3], [2, 0, 5]])
    check('null parent', solve([[2, None]]), [[2, None, None]])
    check('empty parent', solve([[2, []]]), [[2, None, None]])
    check('null element', solve([[2, [None, 3]]]), [[2, 0, None], [2, 1, 3]])
    check('duplicate element', solve([[2, [3, 3]]]), [[2, 0, 3], [2, 1, 3]])
    check('empty input', solve([]), [])
    check('singleton', solve([[6, [2]]]), [[6, 0, 2]])
elif N == 3:
    check('ordered parents', solve([[5, [3, 4]], [3, [6]]]), [[5, 0, 3], [5, 1, 4], [3, 0, 6]])
    check('null parent', solve([[3, None]]), [[3, None, None]])
    check('empty parent', solve([[3, []]]), [[3, None, None]])
    check('null element', solve([[3, [None, 4]]]), [[3, 0, None], [3, 1, 4]])
    check('duplicate element', solve([[3, [4, 4]]]), [[3, 0, 4], [3, 1, 4]])
    check('empty input', solve([]), [])
    check('singleton', solve([[7, [3]]]), [[7, 0, 3]])
elif N == 4:
    check('ordered parents', solve([[6, [4, 5]], [4, [7]]]), [[6, 0, 4], [6, 1, 5], [4, 0, 7]])
    check('null parent', solve([[4, None]]), [[4, None, None]])
    check('empty parent', solve([[4, []]]), [[4, None, None]])
    check('null element', solve([[4, [None, 5]]]), [[4, 0, None], [4, 1, 5]])
    check('duplicate element', solve([[4, [5, 5]]]), [[4, 0, 5], [4, 1, 5]])
    check('empty input', solve([]), [])
    check('singleton', solve([[8, [4]]]), [[8, 0, 4]])
elif N == 5:
    check('ordered parents', solve([[7, [5, 6]], [5, [8]]]), [[7, 0, 5], [7, 1, 6], [5, 0, 8]])
    check('null parent', solve([[5, None]]), [[5, None, None]])
    check('empty parent', solve([[5, []]]), [[5, None, None]])
    check('null element', solve([[5, [None, 6]]]), [[5, 0, None], [5, 1, 6]])
    check('duplicate element', solve([[5, [6, 6]]]), [[5, 0, 6], [5, 1, 6]])
    check('empty input', solve([]), [])
    check('singleton', solve([[9, [5]]]), [[9, 0, 5]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Outer explode drops rows whose list is null.

Explode [id,list-or-None] rows preserving input and element order. Outer semantics yield [id,None,None] for null or empty lists; populated lists yield [id,zero-based-position,value], including null elements.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,values in d:
            if values is None:
                out.append([ident,None,None]); continue
            if not values:
                continue
            for pos,value in enumerate(values):
                out.append([ident,pos,value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('ordered parents', solve([[3, [1, 2]], [1, [4]]]), [[3, 0, 1], [3, 1, 2], [1, 0, 4]])
    check('null parent', solve([[1, None]]), [[1, None, None]])
    check('empty parent', solve([[1, []]]), [[1, None, None]])
    check('null element', solve([[1, [None, 2]]]), [[1, 0, None], [1, 1, 2]])
    check('duplicate element', solve([[1, [2, 2]]]), [[1, 0, 2], [1, 1, 2]])
    check('empty input', solve([]), [])
    check('singleton', solve([[5, [1]]]), [[5, 0, 1]])
elif N == 2:
    check('ordered parents', solve([[4, [2, 3]], [2, [5]]]), [[4, 0, 2], [4, 1, 3], [2, 0, 5]])
    check('null parent', solve([[2, None]]), [[2, None, None]])
    check('empty parent', solve([[2, []]]), [[2, None, None]])
    check('null element', solve([[2, [None, 3]]]), [[2, 0, None], [2, 1, 3]])
    check('duplicate element', solve([[2, [3, 3]]]), [[2, 0, 3], [2, 1, 3]])
    check('empty input', solve([]), [])
    check('singleton', solve([[6, [2]]]), [[6, 0, 2]])
elif N == 3:
    check('ordered parents', solve([[5, [3, 4]], [3, [6]]]), [[5, 0, 3], [5, 1, 4], [3, 0, 6]])
    check('null parent', solve([[3, None]]), [[3, None, None]])
    check('empty parent', solve([[3, []]]), [[3, None, None]])
    check('null element', solve([[3, [None, 4]]]), [[3, 0, None], [3, 1, 4]])
    check('duplicate element', solve([[3, [4, 4]]]), [[3, 0, 4], [3, 1, 4]])
    check('empty input', solve([]), [])
    check('singleton', solve([[7, [3]]]), [[7, 0, 3]])
elif N == 4:
    check('ordered parents', solve([[6, [4, 5]], [4, [7]]]), [[6, 0, 4], [6, 1, 5], [4, 0, 7]])
    check('null parent', solve([[4, None]]), [[4, None, None]])
    check('empty parent', solve([[4, []]]), [[4, None, None]])
    check('null element', solve([[4, [None, 5]]]), [[4, 0, None], [4, 1, 5]])
    check('duplicate element', solve([[4, [5, 5]]]), [[4, 0, 5], [4, 1, 5]])
    check('empty input', solve([]), [])
    check('singleton', solve([[8, [4]]]), [[8, 0, 4]])
elif N == 5:
    check('ordered parents', solve([[7, [5, 6]], [5, [8]]]), [[7, 0, 5], [7, 1, 6], [5, 0, 8]])
    check('null parent', solve([[5, None]]), [[5, None, None]])
    check('empty parent', solve([[5, []]]), [[5, None, None]])
    check('null element', solve([[5, [None, 6]]]), [[5, 0, None], [5, 1, 6]])
    check('duplicate element', solve([[5, [6, 6]]]), [[5, 0, 6], [5, 1, 6]])
    check('empty input', solve([]), [])
    check('singleton', solve([[9, [5]]]), [[9, 0, 5]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,values in d:
            if values is None:
                out.append([ident,None,None]); continue
            if not values:
                out.append([ident,0,None]); continue
            for pos,value in enumerate(values):
                out.append([ident,pos,value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('ordered parents', solve([[3, [1, 2]], [1, [4]]]), [[3, 0, 1], [3, 1, 2], [1, 0, 4]])
    check('null parent', solve([[1, None]]), [[1, None, None]])
    check('empty parent', solve([[1, []]]), [[1, None, None]])
    check('null element', solve([[1, [None, 2]]]), [[1, 0, None], [1, 1, 2]])
    check('duplicate element', solve([[1, [2, 2]]]), [[1, 0, 2], [1, 1, 2]])
    check('empty input', solve([]), [])
    check('singleton', solve([[5, [1]]]), [[5, 0, 1]])
elif N == 2:
    check('ordered parents', solve([[4, [2, 3]], [2, [5]]]), [[4, 0, 2], [4, 1, 3], [2, 0, 5]])
    check('null parent', solve([[2, None]]), [[2, None, None]])
    check('empty parent', solve([[2, []]]), [[2, None, None]])
    check('null element', solve([[2, [None, 3]]]), [[2, 0, None], [2, 1, 3]])
    check('duplicate element', solve([[2, [3, 3]]]), [[2, 0, 3], [2, 1, 3]])
    check('empty input', solve([]), [])
    check('singleton', solve([[6, [2]]]), [[6, 0, 2]])
elif N == 3:
    check('ordered parents', solve([[5, [3, 4]], [3, [6]]]), [[5, 0, 3], [5, 1, 4], [3, 0, 6]])
    check('null parent', solve([[3, None]]), [[3, None, None]])
    check('empty parent', solve([[3, []]]), [[3, None, None]])
    check('null element', solve([[3, [None, 4]]]), [[3, 0, None], [3, 1, 4]])
    check('duplicate element', solve([[3, [4, 4]]]), [[3, 0, 4], [3, 1, 4]])
    check('empty input', solve([]), [])
    check('singleton', solve([[7, [3]]]), [[7, 0, 3]])
elif N == 4:
    check('ordered parents', solve([[6, [4, 5]], [4, [7]]]), [[6, 0, 4], [6, 1, 5], [4, 0, 7]])
    check('null parent', solve([[4, None]]), [[4, None, None]])
    check('empty parent', solve([[4, []]]), [[4, None, None]])
    check('null element', solve([[4, [None, 5]]]), [[4, 0, None], [4, 1, 5]])
    check('duplicate element', solve([[4, [5, 5]]]), [[4, 0, 5], [4, 1, 5]])
    check('empty input', solve([]), [])
    check('singleton', solve([[8, [4]]]), [[8, 0, 4]])
elif N == 5:
    check('ordered parents', solve([[7, [5, 6]], [5, [8]]]), [[7, 0, 5], [7, 1, 6], [5, 0, 8]])
    check('null parent', solve([[5, None]]), [[5, None, None]])
    check('empty parent', solve([[5, []]]), [[5, None, None]])
    check('null element', solve([[5, [None, 6]]]), [[5, 0, None], [5, 1, 6]])
    check('duplicate element', solve([[5, [6, 6]]]), [[5, 0, 6], [5, 1, 6]])
    check('empty input', solve([]), [])
    check('singleton', solve([[9, [5]]]), [[9, 0, 5]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Outer explode drops rows whose list is empty.

Explode [id,list-or-None] rows preserving input and element order. Outer semantics yield [id,None,None] for null or empty lists; populated lists yield [id,zero-based-position,value], including null elements.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,values in d:
            if values is None:
                out.append([ident,None,None]); continue
            if not values:
                out.append([ident,None,None]); continue
            for pos,value in enumerate(values,1):
                out.append([ident,pos,value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('ordered parents', solve([[3, [1, 2]], [1, [4]]]), [[3, 0, 1], [3, 1, 2], [1, 0, 4]])
    check('null parent', solve([[1, None]]), [[1, None, None]])
    check('empty parent', solve([[1, []]]), [[1, None, None]])
    check('null element', solve([[1, [None, 2]]]), [[1, 0, None], [1, 1, 2]])
    check('duplicate element', solve([[1, [2, 2]]]), [[1, 0, 2], [1, 1, 2]])
    check('empty input', solve([]), [])
    check('singleton', solve([[5, [1]]]), [[5, 0, 1]])
elif N == 2:
    check('ordered parents', solve([[4, [2, 3]], [2, [5]]]), [[4, 0, 2], [4, 1, 3], [2, 0, 5]])
    check('null parent', solve([[2, None]]), [[2, None, None]])
    check('empty parent', solve([[2, []]]), [[2, None, None]])
    check('null element', solve([[2, [None, 3]]]), [[2, 0, None], [2, 1, 3]])
    check('duplicate element', solve([[2, [3, 3]]]), [[2, 0, 3], [2, 1, 3]])
    check('empty input', solve([]), [])
    check('singleton', solve([[6, [2]]]), [[6, 0, 2]])
elif N == 3:
    check('ordered parents', solve([[5, [3, 4]], [3, [6]]]), [[5, 0, 3], [5, 1, 4], [3, 0, 6]])
    check('null parent', solve([[3, None]]), [[3, None, None]])
    check('empty parent', solve([[3, []]]), [[3, None, None]])
    check('null element', solve([[3, [None, 4]]]), [[3, 0, None], [3, 1, 4]])
    check('duplicate element', solve([[3, [4, 4]]]), [[3, 0, 4], [3, 1, 4]])
    check('empty input', solve([]), [])
    check('singleton', solve([[7, [3]]]), [[7, 0, 3]])
elif N == 4:
    check('ordered parents', solve([[6, [4, 5]], [4, [7]]]), [[6, 0, 4], [6, 1, 5], [4, 0, 7]])
    check('null parent', solve([[4, None]]), [[4, None, None]])
    check('empty parent', solve([[4, []]]), [[4, None, None]])
    check('null element', solve([[4, [None, 5]]]), [[4, 0, None], [4, 1, 5]])
    check('duplicate element', solve([[4, [5, 5]]]), [[4, 0, 5], [4, 1, 5]])
    check('empty input', solve([]), [])
    check('singleton', solve([[8, [4]]]), [[8, 0, 4]])
elif N == 5:
    check('ordered parents', solve([[7, [5, 6]], [5, [8]]]), [[7, 0, 5], [7, 1, 6], [5, 0, 8]])
    check('null parent', solve([[5, None]]), [[5, None, None]])
    check('empty parent', solve([[5, []]]), [[5, None, None]])
    check('null element', solve([[5, [None, 6]]]), [[5, 0, None], [5, 1, 6]])
    check('duplicate element', solve([[5, [6, 6]]]), [[5, 0, 6], [5, 1, 6]])
    check('empty input', solve([]), [])
    check('singleton', solve([[9, [5]]]), [[9, 0, 5]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,values in d:
            if values is None:
                out.append([ident,None,None]); continue
            if not values:
                out.append([ident,None,None]); continue
            for pos,value in enumerate(reversed(values)):
                out.append([ident,pos,value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('ordered parents', solve([[3, [1, 2]], [1, [4]]]), [[3, 0, 1], [3, 1, 2], [1, 0, 4]])
    check('null parent', solve([[1, None]]), [[1, None, None]])
    check('empty parent', solve([[1, []]]), [[1, None, None]])
    check('null element', solve([[1, [None, 2]]]), [[1, 0, None], [1, 1, 2]])
    check('duplicate element', solve([[1, [2, 2]]]), [[1, 0, 2], [1, 1, 2]])
    check('empty input', solve([]), [])
    check('singleton', solve([[5, [1]]]), [[5, 0, 1]])
elif N == 2:
    check('ordered parents', solve([[4, [2, 3]], [2, [5]]]), [[4, 0, 2], [4, 1, 3], [2, 0, 5]])
    check('null parent', solve([[2, None]]), [[2, None, None]])
    check('empty parent', solve([[2, []]]), [[2, None, None]])
    check('null element', solve([[2, [None, 3]]]), [[2, 0, None], [2, 1, 3]])
    check('duplicate element', solve([[2, [3, 3]]]), [[2, 0, 3], [2, 1, 3]])
    check('empty input', solve([]), [])
    check('singleton', solve([[6, [2]]]), [[6, 0, 2]])
elif N == 3:
    check('ordered parents', solve([[5, [3, 4]], [3, [6]]]), [[5, 0, 3], [5, 1, 4], [3, 0, 6]])
    check('null parent', solve([[3, None]]), [[3, None, None]])
    check('empty parent', solve([[3, []]]), [[3, None, None]])
    check('null element', solve([[3, [None, 4]]]), [[3, 0, None], [3, 1, 4]])
    check('duplicate element', solve([[3, [4, 4]]]), [[3, 0, 4], [3, 1, 4]])
    check('empty input', solve([]), [])
    check('singleton', solve([[7, [3]]]), [[7, 0, 3]])
elif N == 4:
    check('ordered parents', solve([[6, [4, 5]], [4, [7]]]), [[6, 0, 4], [6, 1, 5], [4, 0, 7]])
    check('null parent', solve([[4, None]]), [[4, None, None]])
    check('empty parent', solve([[4, []]]), [[4, None, None]])
    check('null element', solve([[4, [None, 5]]]), [[4, 0, None], [4, 1, 5]])
    check('duplicate element', solve([[4, [5, 5]]]), [[4, 0, 5], [4, 1, 5]])
    check('empty input', solve([]), [])
    check('singleton', solve([[8, [4]]]), [[8, 0, 4]])
elif N == 5:
    check('ordered parents', solve([[7, [5, 6]], [5, [8]]]), [[7, 0, 5], [7, 1, 6], [5, 0, 8]])
    check('null parent', solve([[5, None]]), [[5, None, None]])
    check('empty parent', solve([[5, []]]), [[5, None, None]])
    check('null element', solve([[5, [None, 6]]]), [[5, 0, None], [5, 1, 6]])
    check('duplicate element', solve([[5, [6, 6]]]), [[5, 0, 6], [5, 1, 6]])
    check('empty input', solve([]), [])
    check('singleton', solve([[9, [5]]]), [[9, 0, 5]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Exploded list positions use one-based ordinals.

Explode [id,list-or-None] rows preserving input and element order. Outer semantics yield [id,None,None] for null or empty lists; populated lists yield [id,zero-based-position,value], including null elements.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,values in d:
            if values is None:
                out.append([ident,None,None]); continue
            if not values:
                out.append([ident,None,None]); continue
            for pos,value in enumerate(values):
                if value is not None: out.append([ident,pos,value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('ordered parents', solve([[3, [1, 2]], [1, [4]]]), [[3, 0, 1], [3, 1, 2], [1, 0, 4]])
    check('null parent', solve([[1, None]]), [[1, None, None]])
    check('empty parent', solve([[1, []]]), [[1, None, None]])
    check('null element', solve([[1, [None, 2]]]), [[1, 0, None], [1, 1, 2]])
    check('duplicate element', solve([[1, [2, 2]]]), [[1, 0, 2], [1, 1, 2]])
    check('empty input', solve([]), [])
    check('singleton', solve([[5, [1]]]), [[5, 0, 1]])
elif N == 2:
    check('ordered parents', solve([[4, [2, 3]], [2, [5]]]), [[4, 0, 2], [4, 1, 3], [2, 0, 5]])
    check('null parent', solve([[2, None]]), [[2, None, None]])
    check('empty parent', solve([[2, []]]), [[2, None, None]])
    check('null element', solve([[2, [None, 3]]]), [[2, 0, None], [2, 1, 3]])
    check('duplicate element', solve([[2, [3, 3]]]), [[2, 0, 3], [2, 1, 3]])
    check('empty input', solve([]), [])
    check('singleton', solve([[6, [2]]]), [[6, 0, 2]])
elif N == 3:
    check('ordered parents', solve([[5, [3, 4]], [3, [6]]]), [[5, 0, 3], [5, 1, 4], [3, 0, 6]])
    check('null parent', solve([[3, None]]), [[3, None, None]])
    check('empty parent', solve([[3, []]]), [[3, None, None]])
    check('null element', solve([[3, [None, 4]]]), [[3, 0, None], [3, 1, 4]])
    check('duplicate element', solve([[3, [4, 4]]]), [[3, 0, 4], [3, 1, 4]])
    check('empty input', solve([]), [])
    check('singleton', solve([[7, [3]]]), [[7, 0, 3]])
elif N == 4:
    check('ordered parents', solve([[6, [4, 5]], [4, [7]]]), [[6, 0, 4], [6, 1, 5], [4, 0, 7]])
    check('null parent', solve([[4, None]]), [[4, None, None]])
    check('empty parent', solve([[4, []]]), [[4, None, None]])
    check('null element', solve([[4, [None, 5]]]), [[4, 0, None], [4, 1, 5]])
    check('duplicate element', solve([[4, [5, 5]]]), [[4, 0, 5], [4, 1, 5]])
    check('empty input', solve([]), [])
    check('singleton', solve([[8, [4]]]), [[8, 0, 4]])
elif N == 5:
    check('ordered parents', solve([[7, [5, 6]], [5, [8]]]), [[7, 0, 5], [7, 1, 6], [5, 0, 8]])
    check('null parent', solve([[5, None]]), [[5, None, None]])
    check('empty parent', solve([[5, []]]), [[5, None, None]])
    check('null element', solve([[5, [None, 6]]]), [[5, 0, None], [5, 1, 6]])
    check('duplicate element', solve([[5, [6, 6]]]), [[5, 0, 6], [5, 1, 6]])
    check('empty input', solve([]), [])
    check('singleton', solve([[9, [5]]]), [[9, 0, 5]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,values in d:
            if values is None:
                out.append([ident,None,None]); continue
            if not values:
                out.append([ident,None,None]); continue
            for pos,value in enumerate(values):
                out.append([ident,pos,0 if value is None else value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('ordered parents', solve([[3, [1, 2]], [1, [4]]]), [[3, 0, 1], [3, 1, 2], [1, 0, 4]])
    check('null parent', solve([[1, None]]), [[1, None, None]])
    check('empty parent', solve([[1, []]]), [[1, None, None]])
    check('null element', solve([[1, [None, 2]]]), [[1, 0, None], [1, 1, 2]])
    check('duplicate element', solve([[1, [2, 2]]]), [[1, 0, 2], [1, 1, 2]])
    check('empty input', solve([]), [])
    check('singleton', solve([[5, [1]]]), [[5, 0, 1]])
elif N == 2:
    check('ordered parents', solve([[4, [2, 3]], [2, [5]]]), [[4, 0, 2], [4, 1, 3], [2, 0, 5]])
    check('null parent', solve([[2, None]]), [[2, None, None]])
    check('empty parent', solve([[2, []]]), [[2, None, None]])
    check('null element', solve([[2, [None, 3]]]), [[2, 0, None], [2, 1, 3]])
    check('duplicate element', solve([[2, [3, 3]]]), [[2, 0, 3], [2, 1, 3]])
    check('empty input', solve([]), [])
    check('singleton', solve([[6, [2]]]), [[6, 0, 2]])
elif N == 3:
    check('ordered parents', solve([[5, [3, 4]], [3, [6]]]), [[5, 0, 3], [5, 1, 4], [3, 0, 6]])
    check('null parent', solve([[3, None]]), [[3, None, None]])
    check('empty parent', solve([[3, []]]), [[3, None, None]])
    check('null element', solve([[3, [None, 4]]]), [[3, 0, None], [3, 1, 4]])
    check('duplicate element', solve([[3, [4, 4]]]), [[3, 0, 4], [3, 1, 4]])
    check('empty input', solve([]), [])
    check('singleton', solve([[7, [3]]]), [[7, 0, 3]])
elif N == 4:
    check('ordered parents', solve([[6, [4, 5]], [4, [7]]]), [[6, 0, 4], [6, 1, 5], [4, 0, 7]])
    check('null parent', solve([[4, None]]), [[4, None, None]])
    check('empty parent', solve([[4, []]]), [[4, None, None]])
    check('null element', solve([[4, [None, 5]]]), [[4, 0, None], [4, 1, 5]])
    check('duplicate element', solve([[4, [5, 5]]]), [[4, 0, 5], [4, 1, 5]])
    check('empty input', solve([]), [])
    check('singleton', solve([[8, [4]]]), [[8, 0, 4]])
elif N == 5:
    check('ordered parents', solve([[7, [5, 6]], [5, [8]]]), [[7, 0, 5], [7, 1, 6], [5, 0, 8]])
    check('null parent', solve([[5, None]]), [[5, None, None]])
    check('empty parent', solve([[5, []]]), [[5, None, None]])
    check('null element', solve([[5, [None, 6]]]), [[5, 0, None], [5, 1, 6]])
    check('duplicate element', solve([[5, [6, 6]]]), [[5, 0, 6], [5, 1, 6]])
    check('empty input', solve([]), [])
    check('singleton', solve([[9, [5]]]), [[9, 0, 5]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Explode filters null list elements.

Explode [id,list-or-None] rows preserving input and element order. Outer semantics yield [id,None,None] for null or empty lists; populated lists yield [id,zero-based-position,value], including null elements.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,values in sorted(d,key=lambda row:row[0]):
            if values is None:
                out.append([ident,None,None]); continue
            if not values:
                out.append([ident,None,None]); continue
            for pos,value in enumerate(values):
                out.append([ident,pos,value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('ordered parents', solve([[3, [1, 2]], [1, [4]]]), [[3, 0, 1], [3, 1, 2], [1, 0, 4]])
    check('null parent', solve([[1, None]]), [[1, None, None]])
    check('empty parent', solve([[1, []]]), [[1, None, None]])
    check('null element', solve([[1, [None, 2]]]), [[1, 0, None], [1, 1, 2]])
    check('duplicate element', solve([[1, [2, 2]]]), [[1, 0, 2], [1, 1, 2]])
    check('empty input', solve([]), [])
    check('singleton', solve([[5, [1]]]), [[5, 0, 1]])
elif N == 2:
    check('ordered parents', solve([[4, [2, 3]], [2, [5]]]), [[4, 0, 2], [4, 1, 3], [2, 0, 5]])
    check('null parent', solve([[2, None]]), [[2, None, None]])
    check('empty parent', solve([[2, []]]), [[2, None, None]])
    check('null element', solve([[2, [None, 3]]]), [[2, 0, None], [2, 1, 3]])
    check('duplicate element', solve([[2, [3, 3]]]), [[2, 0, 3], [2, 1, 3]])
    check('empty input', solve([]), [])
    check('singleton', solve([[6, [2]]]), [[6, 0, 2]])
elif N == 3:
    check('ordered parents', solve([[5, [3, 4]], [3, [6]]]), [[5, 0, 3], [5, 1, 4], [3, 0, 6]])
    check('null parent', solve([[3, None]]), [[3, None, None]])
    check('empty parent', solve([[3, []]]), [[3, None, None]])
    check('null element', solve([[3, [None, 4]]]), [[3, 0, None], [3, 1, 4]])
    check('duplicate element', solve([[3, [4, 4]]]), [[3, 0, 4], [3, 1, 4]])
    check('empty input', solve([]), [])
    check('singleton', solve([[7, [3]]]), [[7, 0, 3]])
elif N == 4:
    check('ordered parents', solve([[6, [4, 5]], [4, [7]]]), [[6, 0, 4], [6, 1, 5], [4, 0, 7]])
    check('null parent', solve([[4, None]]), [[4, None, None]])
    check('empty parent', solve([[4, []]]), [[4, None, None]])
    check('null element', solve([[4, [None, 5]]]), [[4, 0, None], [4, 1, 5]])
    check('duplicate element', solve([[4, [5, 5]]]), [[4, 0, 5], [4, 1, 5]])
    check('empty input', solve([]), [])
    check('singleton', solve([[8, [4]]]), [[8, 0, 4]])
elif N == 5:
    check('ordered parents', solve([[7, [5, 6]], [5, [8]]]), [[7, 0, 5], [7, 1, 6], [5, 0, 8]])
    check('null parent', solve([[5, None]]), [[5, None, None]])
    check('empty parent', solve([[5, []]]), [[5, None, None]])
    check('null element', solve([[5, [None, 6]]]), [[5, 0, None], [5, 1, 6]])
    check('duplicate element', solve([[5, [6, 6]]]), [[5, 0, 6], [5, 1, 6]])
    check('empty input', solve([]), [])
    check('singleton', solve([[9, [5]]]), [[9, 0, 5]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,values in reversed(d):
            if values is None:
                out.append([ident,None,None]); continue
            if not values:
                out.append([ident,None,None]); continue
            for pos,value in enumerate(values):
                out.append([ident,pos,value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('ordered parents', solve([[3, [1, 2]], [1, [4]]]), [[3, 0, 1], [3, 1, 2], [1, 0, 4]])
    check('null parent', solve([[1, None]]), [[1, None, None]])
    check('empty parent', solve([[1, []]]), [[1, None, None]])
    check('null element', solve([[1, [None, 2]]]), [[1, 0, None], [1, 1, 2]])
    check('duplicate element', solve([[1, [2, 2]]]), [[1, 0, 2], [1, 1, 2]])
    check('empty input', solve([]), [])
    check('singleton', solve([[5, [1]]]), [[5, 0, 1]])
elif N == 2:
    check('ordered parents', solve([[4, [2, 3]], [2, [5]]]), [[4, 0, 2], [4, 1, 3], [2, 0, 5]])
    check('null parent', solve([[2, None]]), [[2, None, None]])
    check('empty parent', solve([[2, []]]), [[2, None, None]])
    check('null element', solve([[2, [None, 3]]]), [[2, 0, None], [2, 1, 3]])
    check('duplicate element', solve([[2, [3, 3]]]), [[2, 0, 3], [2, 1, 3]])
    check('empty input', solve([]), [])
    check('singleton', solve([[6, [2]]]), [[6, 0, 2]])
elif N == 3:
    check('ordered parents', solve([[5, [3, 4]], [3, [6]]]), [[5, 0, 3], [5, 1, 4], [3, 0, 6]])
    check('null parent', solve([[3, None]]), [[3, None, None]])
    check('empty parent', solve([[3, []]]), [[3, None, None]])
    check('null element', solve([[3, [None, 4]]]), [[3, 0, None], [3, 1, 4]])
    check('duplicate element', solve([[3, [4, 4]]]), [[3, 0, 4], [3, 1, 4]])
    check('empty input', solve([]), [])
    check('singleton', solve([[7, [3]]]), [[7, 0, 3]])
elif N == 4:
    check('ordered parents', solve([[6, [4, 5]], [4, [7]]]), [[6, 0, 4], [6, 1, 5], [4, 0, 7]])
    check('null parent', solve([[4, None]]), [[4, None, None]])
    check('empty parent', solve([[4, []]]), [[4, None, None]])
    check('null element', solve([[4, [None, 5]]]), [[4, 0, None], [4, 1, 5]])
    check('duplicate element', solve([[4, [5, 5]]]), [[4, 0, 5], [4, 1, 5]])
    check('empty input', solve([]), [])
    check('singleton', solve([[8, [4]]]), [[8, 0, 4]])
elif N == 5:
    check('ordered parents', solve([[7, [5, 6]], [5, [8]]]), [[7, 0, 5], [7, 1, 6], [5, 0, 8]])
    check('null parent', solve([[5, None]]), [[5, None, None]])
    check('empty parent', solve([[5, []]]), [[5, None, None]])
    check('null element', solve([[5, [None, 6]]]), [[5, 0, None], [5, 1, 6]])
    check('duplicate element', solve([[5, [6, 6]]]), [[5, 0, 6], [5, 1, 6]])
    check('empty input', solve([]), [])
    check('singleton', solve([[9, [5]]]), [[9, 0, 5]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Outer explode sorts parent rows before expansion.

Explode [id,list-or-None] rows preserving input and element order. Outer semantics yield [id,None,None] for null or empty lists; populated lists yield [id,zero-based-position,value], including null elements.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,values in d:
            if values is None:
                out.append([ident,None,None]); continue
            if not values:
                out.append([ident,None,None]); continue
            for pos,value in enumerate(values):
                out.append([pos,pos,value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('ordered parents', solve([[3, [1, 2]], [1, [4]]]), [[3, 0, 1], [3, 1, 2], [1, 0, 4]])
    check('null parent', solve([[1, None]]), [[1, None, None]])
    check('empty parent', solve([[1, []]]), [[1, None, None]])
    check('null element', solve([[1, [None, 2]]]), [[1, 0, None], [1, 1, 2]])
    check('duplicate element', solve([[1, [2, 2]]]), [[1, 0, 2], [1, 1, 2]])
    check('empty input', solve([]), [])
    check('singleton', solve([[5, [1]]]), [[5, 0, 1]])
elif N == 2:
    check('ordered parents', solve([[4, [2, 3]], [2, [5]]]), [[4, 0, 2], [4, 1, 3], [2, 0, 5]])
    check('null parent', solve([[2, None]]), [[2, None, None]])
    check('empty parent', solve([[2, []]]), [[2, None, None]])
    check('null element', solve([[2, [None, 3]]]), [[2, 0, None], [2, 1, 3]])
    check('duplicate element', solve([[2, [3, 3]]]), [[2, 0, 3], [2, 1, 3]])
    check('empty input', solve([]), [])
    check('singleton', solve([[6, [2]]]), [[6, 0, 2]])
elif N == 3:
    check('ordered parents', solve([[5, [3, 4]], [3, [6]]]), [[5, 0, 3], [5, 1, 4], [3, 0, 6]])
    check('null parent', solve([[3, None]]), [[3, None, None]])
    check('empty parent', solve([[3, []]]), [[3, None, None]])
    check('null element', solve([[3, [None, 4]]]), [[3, 0, None], [3, 1, 4]])
    check('duplicate element', solve([[3, [4, 4]]]), [[3, 0, 4], [3, 1, 4]])
    check('empty input', solve([]), [])
    check('singleton', solve([[7, [3]]]), [[7, 0, 3]])
elif N == 4:
    check('ordered parents', solve([[6, [4, 5]], [4, [7]]]), [[6, 0, 4], [6, 1, 5], [4, 0, 7]])
    check('null parent', solve([[4, None]]), [[4, None, None]])
    check('empty parent', solve([[4, []]]), [[4, None, None]])
    check('null element', solve([[4, [None, 5]]]), [[4, 0, None], [4, 1, 5]])
    check('duplicate element', solve([[4, [5, 5]]]), [[4, 0, 5], [4, 1, 5]])
    check('empty input', solve([]), [])
    check('singleton', solve([[8, [4]]]), [[8, 0, 4]])
elif N == 5:
    check('ordered parents', solve([[7, [5, 6]], [5, [8]]]), [[7, 0, 5], [7, 1, 6], [5, 0, 8]])
    check('null parent', solve([[5, None]]), [[5, None, None]])
    check('empty parent', solve([[5, []]]), [[5, None, None]])
    check('null element', solve([[5, [None, 6]]]), [[5, 0, None], [5, 1, 6]])
    check('duplicate element', solve([[5, [6, 6]]]), [[5, 0, 6], [5, 1, 6]])
    check('empty input', solve([]), [])
    check('singleton', solve([[9, [5]]]), [[9, 0, 5]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,values in d:
            if values is None:
                out.append([ident,None,None]); continue
            if not values:
                out.append([ident,None,None]); continue
            for pos,value in enumerate(values):
                out.append([value,pos,value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('ordered parents', solve([[3, [1, 2]], [1, [4]]]), [[3, 0, 1], [3, 1, 2], [1, 0, 4]])
    check('null parent', solve([[1, None]]), [[1, None, None]])
    check('empty parent', solve([[1, []]]), [[1, None, None]])
    check('null element', solve([[1, [None, 2]]]), [[1, 0, None], [1, 1, 2]])
    check('duplicate element', solve([[1, [2, 2]]]), [[1, 0, 2], [1, 1, 2]])
    check('empty input', solve([]), [])
    check('singleton', solve([[5, [1]]]), [[5, 0, 1]])
elif N == 2:
    check('ordered parents', solve([[4, [2, 3]], [2, [5]]]), [[4, 0, 2], [4, 1, 3], [2, 0, 5]])
    check('null parent', solve([[2, None]]), [[2, None, None]])
    check('empty parent', solve([[2, []]]), [[2, None, None]])
    check('null element', solve([[2, [None, 3]]]), [[2, 0, None], [2, 1, 3]])
    check('duplicate element', solve([[2, [3, 3]]]), [[2, 0, 3], [2, 1, 3]])
    check('empty input', solve([]), [])
    check('singleton', solve([[6, [2]]]), [[6, 0, 2]])
elif N == 3:
    check('ordered parents', solve([[5, [3, 4]], [3, [6]]]), [[5, 0, 3], [5, 1, 4], [3, 0, 6]])
    check('null parent', solve([[3, None]]), [[3, None, None]])
    check('empty parent', solve([[3, []]]), [[3, None, None]])
    check('null element', solve([[3, [None, 4]]]), [[3, 0, None], [3, 1, 4]])
    check('duplicate element', solve([[3, [4, 4]]]), [[3, 0, 4], [3, 1, 4]])
    check('empty input', solve([]), [])
    check('singleton', solve([[7, [3]]]), [[7, 0, 3]])
elif N == 4:
    check('ordered parents', solve([[6, [4, 5]], [4, [7]]]), [[6, 0, 4], [6, 1, 5], [4, 0, 7]])
    check('null parent', solve([[4, None]]), [[4, None, None]])
    check('empty parent', solve([[4, []]]), [[4, None, None]])
    check('null element', solve([[4, [None, 5]]]), [[4, 0, None], [4, 1, 5]])
    check('duplicate element', solve([[4, [5, 5]]]), [[4, 0, 5], [4, 1, 5]])
    check('empty input', solve([]), [])
    check('singleton', solve([[8, [4]]]), [[8, 0, 4]])
elif N == 5:
    check('ordered parents', solve([[7, [5, 6]], [5, [8]]]), [[7, 0, 5], [7, 1, 6], [5, 0, 8]])
    check('null parent', solve([[5, None]]), [[5, None, None]])
    check('empty parent', solve([[5, []]]), [[5, None, None]])
    check('null element', solve([[5, [None, 6]]]), [[5, 0, None], [5, 1, 6]])
    check('duplicate element', solve([[5, [6, 6]]]), [[5, 0, 6], [5, 1, 6]])
    check('empty input', solve([]), [])
    check('singleton', solve([[9, [5]]]), [[9, 0, 5]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Explode uses the element position as its parent identity.

Explode [id,list-or-None] rows preserving input and element order. Outer semantics yield [id,None,None] for null or empty lists; populated lists yield [id,zero-based-position,value], including null elements.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,left,right in d:
            left=[] if left is None else left
            right=[] if right is None else right
            size=min(len(left),len(right))
            if size==0: out.append([ident,None,None,None])
            for i in range(size):
                a=left[i] if i<len(left) else None
                b=right[i] if i<len(right) else None
                out.append([ident,i,a,b])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('longer left', solve([[1, [2, 3], [4]]]), [[1, 0, 2, 4], [1, 1, 3, None]])
    check('longer right', solve([[1, [2], [3, 4]]]), [[1, 0, 2, 3], [1, 1, None, 4]])
    check('empty both', solve([[1, [], None]]), [[1, None, None, None]])
    check('null left', solve([[1, None, [2]]]), [[1, 0, None, 2]])
    check('parent ordinal reset', solve([[1, [1], []], [2, [None], [3]]]), [[1, 0, 1, None], [2, 0, None, 3]])
    check('empty relation', solve([]), [])
    check('null right', solve([[1, [2], None]]), [[1, 0, 2, None]])
elif N == 2:
    check('longer left', solve([[2, [3, 4], [5]]]), [[2, 0, 3, 5], [2, 1, 4, None]])
    check('longer right', solve([[2, [3], [4, 5]]]), [[2, 0, 3, 4], [2, 1, None, 5]])
    check('empty both', solve([[2, [], None]]), [[2, None, None, None]])
    check('null left', solve([[2, None, [3]]]), [[2, 0, None, 3]])
    check('parent ordinal reset', solve([[2, [2], []], [3, [None], [4]]]), [[2, 0, 2, None], [3, 0, None, 4]])
    check('empty relation', solve([]), [])
    check('null right', solve([[2, [3], None]]), [[2, 0, 3, None]])
elif N == 3:
    check('longer left', solve([[3, [4, 5], [6]]]), [[3, 0, 4, 6], [3, 1, 5, None]])
    check('longer right', solve([[3, [4], [5, 6]]]), [[3, 0, 4, 5], [3, 1, None, 6]])
    check('empty both', solve([[3, [], None]]), [[3, None, None, None]])
    check('null left', solve([[3, None, [4]]]), [[3, 0, None, 4]])
    check('parent ordinal reset', solve([[3, [3], []], [4, [None], [5]]]), [[3, 0, 3, None], [4, 0, None, 5]])
    check('empty relation', solve([]), [])
    check('null right', solve([[3, [4], None]]), [[3, 0, 4, None]])
elif N == 4:
    check('longer left', solve([[4, [5, 6], [7]]]), [[4, 0, 5, 7], [4, 1, 6, None]])
    check('longer right', solve([[4, [5], [6, 7]]]), [[4, 0, 5, 6], [4, 1, None, 7]])
    check('empty both', solve([[4, [], None]]), [[4, None, None, None]])
    check('null left', solve([[4, None, [5]]]), [[4, 0, None, 5]])
    check('parent ordinal reset', solve([[4, [4], []], [5, [None], [6]]]), [[4, 0, 4, None], [5, 0, None, 6]])
    check('empty relation', solve([]), [])
    check('null right', solve([[4, [5], None]]), [[4, 0, 5, None]])
elif N == 5:
    check('longer left', solve([[5, [6, 7], [8]]]), [[5, 0, 6, 8], [5, 1, 7, None]])
    check('longer right', solve([[5, [6], [7, 8]]]), [[5, 0, 6, 7], [5, 1, None, 8]])
    check('empty both', solve([[5, [], None]]), [[5, None, None, None]])
    check('null left', solve([[5, None, [6]]]), [[5, 0, None, 6]])
    check('parent ordinal reset', solve([[5, [5], []], [6, [None], [7]]]), [[5, 0, 5, None], [6, 0, None, 7]])
    check('empty relation', solve([]), [])
    check('null right', solve([[5, [6], None]]), [[5, 0, 6, None]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,left,right in d:
            left=[] if left is None else left
            right=[] if right is None else right
            size=len(left)
            if size==0: out.append([ident,None,None,None])
            for i in range(size):
                a=left[i] if i<len(left) else None
                b=right[i] if i<len(right) else None
                out.append([ident,i,a,b])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('longer left', solve([[1, [2, 3], [4]]]), [[1, 0, 2, 4], [1, 1, 3, None]])
    check('longer right', solve([[1, [2], [3, 4]]]), [[1, 0, 2, 3], [1, 1, None, 4]])
    check('empty both', solve([[1, [], None]]), [[1, None, None, None]])
    check('null left', solve([[1, None, [2]]]), [[1, 0, None, 2]])
    check('parent ordinal reset', solve([[1, [1], []], [2, [None], [3]]]), [[1, 0, 1, None], [2, 0, None, 3]])
    check('empty relation', solve([]), [])
    check('null right', solve([[1, [2], None]]), [[1, 0, 2, None]])
elif N == 2:
    check('longer left', solve([[2, [3, 4], [5]]]), [[2, 0, 3, 5], [2, 1, 4, None]])
    check('longer right', solve([[2, [3], [4, 5]]]), [[2, 0, 3, 4], [2, 1, None, 5]])
    check('empty both', solve([[2, [], None]]), [[2, None, None, None]])
    check('null left', solve([[2, None, [3]]]), [[2, 0, None, 3]])
    check('parent ordinal reset', solve([[2, [2], []], [3, [None], [4]]]), [[2, 0, 2, None], [3, 0, None, 4]])
    check('empty relation', solve([]), [])
    check('null right', solve([[2, [3], None]]), [[2, 0, 3, None]])
elif N == 3:
    check('longer left', solve([[3, [4, 5], [6]]]), [[3, 0, 4, 6], [3, 1, 5, None]])
    check('longer right', solve([[3, [4], [5, 6]]]), [[3, 0, 4, 5], [3, 1, None, 6]])
    check('empty both', solve([[3, [], None]]), [[3, None, None, None]])
    check('null left', solve([[3, None, [4]]]), [[3, 0, None, 4]])
    check('parent ordinal reset', solve([[3, [3], []], [4, [None], [5]]]), [[3, 0, 3, None], [4, 0, None, 5]])
    check('empty relation', solve([]), [])
    check('null right', solve([[3, [4], None]]), [[3, 0, 4, None]])
elif N == 4:
    check('longer left', solve([[4, [5, 6], [7]]]), [[4, 0, 5, 7], [4, 1, 6, None]])
    check('longer right', solve([[4, [5], [6, 7]]]), [[4, 0, 5, 6], [4, 1, None, 7]])
    check('empty both', solve([[4, [], None]]), [[4, None, None, None]])
    check('null left', solve([[4, None, [5]]]), [[4, 0, None, 5]])
    check('parent ordinal reset', solve([[4, [4], []], [5, [None], [6]]]), [[4, 0, 4, None], [5, 0, None, 6]])
    check('empty relation', solve([]), [])
    check('null right', solve([[4, [5], None]]), [[4, 0, 5, None]])
elif N == 5:
    check('longer left', solve([[5, [6, 7], [8]]]), [[5, 0, 6, 8], [5, 1, 7, None]])
    check('longer right', solve([[5, [6], [7, 8]]]), [[5, 0, 6, 7], [5, 1, None, 8]])
    check('empty both', solve([[5, [], None]]), [[5, None, None, None]])
    check('null left', solve([[5, None, [6]]]), [[5, 0, None, 6]])
    check('parent ordinal reset', solve([[5, [5], []], [6, [None], [7]]]), [[5, 0, 5, None], [6, 0, None, 7]])
    check('empty relation', solve([]), [])
    check('null right', solve([[5, [6], None]]), [[5, 0, 6, None]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Zip unnest truncates to the shorter list.

Zip two optional lists within each parent row using longest-list semantics and zero-based ordinals. Missing positions become None; two empty or null lists yield one outer placeholder with ordinal None.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,left,right in d:
            left=[] if left is None else left
            right=[] if right is None else right
            size=max(len(left),len(right))
            if size==0: pass
            for i in range(size):
                a=left[i] if i<len(left) else None
                b=right[i] if i<len(right) else None
                out.append([ident,i,a,b])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('longer left', solve([[1, [2, 3], [4]]]), [[1, 0, 2, 4], [1, 1, 3, None]])
    check('longer right', solve([[1, [2], [3, 4]]]), [[1, 0, 2, 3], [1, 1, None, 4]])
    check('empty both', solve([[1, [], None]]), [[1, None, None, None]])
    check('null left', solve([[1, None, [2]]]), [[1, 0, None, 2]])
    check('parent ordinal reset', solve([[1, [1], []], [2, [None], [3]]]), [[1, 0, 1, None], [2, 0, None, 3]])
    check('empty relation', solve([]), [])
    check('null right', solve([[1, [2], None]]), [[1, 0, 2, None]])
elif N == 2:
    check('longer left', solve([[2, [3, 4], [5]]]), [[2, 0, 3, 5], [2, 1, 4, None]])
    check('longer right', solve([[2, [3], [4, 5]]]), [[2, 0, 3, 4], [2, 1, None, 5]])
    check('empty both', solve([[2, [], None]]), [[2, None, None, None]])
    check('null left', solve([[2, None, [3]]]), [[2, 0, None, 3]])
    check('parent ordinal reset', solve([[2, [2], []], [3, [None], [4]]]), [[2, 0, 2, None], [3, 0, None, 4]])
    check('empty relation', solve([]), [])
    check('null right', solve([[2, [3], None]]), [[2, 0, 3, None]])
elif N == 3:
    check('longer left', solve([[3, [4, 5], [6]]]), [[3, 0, 4, 6], [3, 1, 5, None]])
    check('longer right', solve([[3, [4], [5, 6]]]), [[3, 0, 4, 5], [3, 1, None, 6]])
    check('empty both', solve([[3, [], None]]), [[3, None, None, None]])
    check('null left', solve([[3, None, [4]]]), [[3, 0, None, 4]])
    check('parent ordinal reset', solve([[3, [3], []], [4, [None], [5]]]), [[3, 0, 3, None], [4, 0, None, 5]])
    check('empty relation', solve([]), [])
    check('null right', solve([[3, [4], None]]), [[3, 0, 4, None]])
elif N == 4:
    check('longer left', solve([[4, [5, 6], [7]]]), [[4, 0, 5, 7], [4, 1, 6, None]])
    check('longer right', solve([[4, [5], [6, 7]]]), [[4, 0, 5, 6], [4, 1, None, 7]])
    check('empty both', solve([[4, [], None]]), [[4, None, None, None]])
    check('null left', solve([[4, None, [5]]]), [[4, 0, None, 5]])
    check('parent ordinal reset', solve([[4, [4], []], [5, [None], [6]]]), [[4, 0, 4, None], [5, 0, None, 6]])
    check('empty relation', solve([]), [])
    check('null right', solve([[4, [5], None]]), [[4, 0, 5, None]])
elif N == 5:
    check('longer left', solve([[5, [6, 7], [8]]]), [[5, 0, 6, 8], [5, 1, 7, None]])
    check('longer right', solve([[5, [6], [7, 8]]]), [[5, 0, 6, 7], [5, 1, None, 8]])
    check('empty both', solve([[5, [], None]]), [[5, None, None, None]])
    check('null left', solve([[5, None, [6]]]), [[5, 0, None, 6]])
    check('parent ordinal reset', solve([[5, [5], []], [6, [None], [7]]]), [[5, 0, 5, None], [6, 0, None, 7]])
    check('empty relation', solve([]), [])
    check('null right', solve([[5, [6], None]]), [[5, 0, 6, None]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,left,right in d:
            left=[] if left is None else left
            right=[] if right is None else right
            size=max(len(left),len(right))
            if size==0: out.append([ident,0,None,None])
            for i in range(size):
                a=left[i] if i<len(left) else None
                b=right[i] if i<len(right) else None
                out.append([ident,i,a,b])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('longer left', solve([[1, [2, 3], [4]]]), [[1, 0, 2, 4], [1, 1, 3, None]])
    check('longer right', solve([[1, [2], [3, 4]]]), [[1, 0, 2, 3], [1, 1, None, 4]])
    check('empty both', solve([[1, [], None]]), [[1, None, None, None]])
    check('null left', solve([[1, None, [2]]]), [[1, 0, None, 2]])
    check('parent ordinal reset', solve([[1, [1], []], [2, [None], [3]]]), [[1, 0, 1, None], [2, 0, None, 3]])
    check('empty relation', solve([]), [])
    check('null right', solve([[1, [2], None]]), [[1, 0, 2, None]])
elif N == 2:
    check('longer left', solve([[2, [3, 4], [5]]]), [[2, 0, 3, 5], [2, 1, 4, None]])
    check('longer right', solve([[2, [3], [4, 5]]]), [[2, 0, 3, 4], [2, 1, None, 5]])
    check('empty both', solve([[2, [], None]]), [[2, None, None, None]])
    check('null left', solve([[2, None, [3]]]), [[2, 0, None, 3]])
    check('parent ordinal reset', solve([[2, [2], []], [3, [None], [4]]]), [[2, 0, 2, None], [3, 0, None, 4]])
    check('empty relation', solve([]), [])
    check('null right', solve([[2, [3], None]]), [[2, 0, 3, None]])
elif N == 3:
    check('longer left', solve([[3, [4, 5], [6]]]), [[3, 0, 4, 6], [3, 1, 5, None]])
    check('longer right', solve([[3, [4], [5, 6]]]), [[3, 0, 4, 5], [3, 1, None, 6]])
    check('empty both', solve([[3, [], None]]), [[3, None, None, None]])
    check('null left', solve([[3, None, [4]]]), [[3, 0, None, 4]])
    check('parent ordinal reset', solve([[3, [3], []], [4, [None], [5]]]), [[3, 0, 3, None], [4, 0, None, 5]])
    check('empty relation', solve([]), [])
    check('null right', solve([[3, [4], None]]), [[3, 0, 4, None]])
elif N == 4:
    check('longer left', solve([[4, [5, 6], [7]]]), [[4, 0, 5, 7], [4, 1, 6, None]])
    check('longer right', solve([[4, [5], [6, 7]]]), [[4, 0, 5, 6], [4, 1, None, 7]])
    check('empty both', solve([[4, [], None]]), [[4, None, None, None]])
    check('null left', solve([[4, None, [5]]]), [[4, 0, None, 5]])
    check('parent ordinal reset', solve([[4, [4], []], [5, [None], [6]]]), [[4, 0, 4, None], [5, 0, None, 6]])
    check('empty relation', solve([]), [])
    check('null right', solve([[4, [5], None]]), [[4, 0, 5, None]])
elif N == 5:
    check('longer left', solve([[5, [6, 7], [8]]]), [[5, 0, 6, 8], [5, 1, 7, None]])
    check('longer right', solve([[5, [6], [7, 8]]]), [[5, 0, 6, 7], [5, 1, None, 8]])
    check('empty both', solve([[5, [], None]]), [[5, None, None, None]])
    check('null left', solve([[5, None, [6]]]), [[5, 0, None, 6]])
    check('parent ordinal reset', solve([[5, [5], []], [6, [None], [7]]]), [[5, 0, 5, None], [6, 0, None, 7]])
    check('empty relation', solve([]), [])
    check('null right', solve([[5, [6], None]]), [[5, 0, 6, None]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Zip unnest omits a parent with two empty lists.

Zip two optional lists within each parent row using longest-list semantics and zero-based ordinals. Missing positions become None; two empty or null lists yield one outer placeholder with ordinal None.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,left,right in d:
            left=[] if left is None else left
            right=[] if right is None else right
            size=max(len(left),len(right))
            if size==0: out.append([ident,None,None,None])
            for i in range(size):
                a=left[i] if i<len(left) else (left[-1] if left else None)
                b=right[i] if i<len(right) else None
                out.append([ident,i,a,b])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('longer left', solve([[1, [2, 3], [4]]]), [[1, 0, 2, 4], [1, 1, 3, None]])
    check('longer right', solve([[1, [2], [3, 4]]]), [[1, 0, 2, 3], [1, 1, None, 4]])
    check('empty both', solve([[1, [], None]]), [[1, None, None, None]])
    check('null left', solve([[1, None, [2]]]), [[1, 0, None, 2]])
    check('parent ordinal reset', solve([[1, [1], []], [2, [None], [3]]]), [[1, 0, 1, None], [2, 0, None, 3]])
    check('empty relation', solve([]), [])
    check('null right', solve([[1, [2], None]]), [[1, 0, 2, None]])
elif N == 2:
    check('longer left', solve([[2, [3, 4], [5]]]), [[2, 0, 3, 5], [2, 1, 4, None]])
    check('longer right', solve([[2, [3], [4, 5]]]), [[2, 0, 3, 4], [2, 1, None, 5]])
    check('empty both', solve([[2, [], None]]), [[2, None, None, None]])
    check('null left', solve([[2, None, [3]]]), [[2, 0, None, 3]])
    check('parent ordinal reset', solve([[2, [2], []], [3, [None], [4]]]), [[2, 0, 2, None], [3, 0, None, 4]])
    check('empty relation', solve([]), [])
    check('null right', solve([[2, [3], None]]), [[2, 0, 3, None]])
elif N == 3:
    check('longer left', solve([[3, [4, 5], [6]]]), [[3, 0, 4, 6], [3, 1, 5, None]])
    check('longer right', solve([[3, [4], [5, 6]]]), [[3, 0, 4, 5], [3, 1, None, 6]])
    check('empty both', solve([[3, [], None]]), [[3, None, None, None]])
    check('null left', solve([[3, None, [4]]]), [[3, 0, None, 4]])
    check('parent ordinal reset', solve([[3, [3], []], [4, [None], [5]]]), [[3, 0, 3, None], [4, 0, None, 5]])
    check('empty relation', solve([]), [])
    check('null right', solve([[3, [4], None]]), [[3, 0, 4, None]])
elif N == 4:
    check('longer left', solve([[4, [5, 6], [7]]]), [[4, 0, 5, 7], [4, 1, 6, None]])
    check('longer right', solve([[4, [5], [6, 7]]]), [[4, 0, 5, 6], [4, 1, None, 7]])
    check('empty both', solve([[4, [], None]]), [[4, None, None, None]])
    check('null left', solve([[4, None, [5]]]), [[4, 0, None, 5]])
    check('parent ordinal reset', solve([[4, [4], []], [5, [None], [6]]]), [[4, 0, 4, None], [5, 0, None, 6]])
    check('empty relation', solve([]), [])
    check('null right', solve([[4, [5], None]]), [[4, 0, 5, None]])
elif N == 5:
    check('longer left', solve([[5, [6, 7], [8]]]), [[5, 0, 6, 8], [5, 1, 7, None]])
    check('longer right', solve([[5, [6], [7, 8]]]), [[5, 0, 6, 7], [5, 1, None, 8]])
    check('empty both', solve([[5, [], None]]), [[5, None, None, None]])
    check('null left', solve([[5, None, [6]]]), [[5, 0, None, 6]])
    check('parent ordinal reset', solve([[5, [5], []], [6, [None], [7]]]), [[5, 0, 5, None], [6, 0, None, 7]])
    check('empty relation', solve([]), [])
    check('null right', solve([[5, [6], None]]), [[5, 0, 6, None]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,left,right in d:
            left=[] if left is None else left
            right=[] if right is None else right
            size=max(len(left),len(right))
            if size==0: out.append([ident,None,None,None])
            for i in range(size):
                a=left[i] if i<len(left) else 0
                b=right[i] if i<len(right) else None
                out.append([ident,i,a,b])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('longer left', solve([[1, [2, 3], [4]]]), [[1, 0, 2, 4], [1, 1, 3, None]])
    check('longer right', solve([[1, [2], [3, 4]]]), [[1, 0, 2, 3], [1, 1, None, 4]])
    check('empty both', solve([[1, [], None]]), [[1, None, None, None]])
    check('null left', solve([[1, None, [2]]]), [[1, 0, None, 2]])
    check('parent ordinal reset', solve([[1, [1], []], [2, [None], [3]]]), [[1, 0, 1, None], [2, 0, None, 3]])
    check('empty relation', solve([]), [])
    check('null right', solve([[1, [2], None]]), [[1, 0, 2, None]])
elif N == 2:
    check('longer left', solve([[2, [3, 4], [5]]]), [[2, 0, 3, 5], [2, 1, 4, None]])
    check('longer right', solve([[2, [3], [4, 5]]]), [[2, 0, 3, 4], [2, 1, None, 5]])
    check('empty both', solve([[2, [], None]]), [[2, None, None, None]])
    check('null left', solve([[2, None, [3]]]), [[2, 0, None, 3]])
    check('parent ordinal reset', solve([[2, [2], []], [3, [None], [4]]]), [[2, 0, 2, None], [3, 0, None, 4]])
    check('empty relation', solve([]), [])
    check('null right', solve([[2, [3], None]]), [[2, 0, 3, None]])
elif N == 3:
    check('longer left', solve([[3, [4, 5], [6]]]), [[3, 0, 4, 6], [3, 1, 5, None]])
    check('longer right', solve([[3, [4], [5, 6]]]), [[3, 0, 4, 5], [3, 1, None, 6]])
    check('empty both', solve([[3, [], None]]), [[3, None, None, None]])
    check('null left', solve([[3, None, [4]]]), [[3, 0, None, 4]])
    check('parent ordinal reset', solve([[3, [3], []], [4, [None], [5]]]), [[3, 0, 3, None], [4, 0, None, 5]])
    check('empty relation', solve([]), [])
    check('null right', solve([[3, [4], None]]), [[3, 0, 4, None]])
elif N == 4:
    check('longer left', solve([[4, [5, 6], [7]]]), [[4, 0, 5, 7], [4, 1, 6, None]])
    check('longer right', solve([[4, [5], [6, 7]]]), [[4, 0, 5, 6], [4, 1, None, 7]])
    check('empty both', solve([[4, [], None]]), [[4, None, None, None]])
    check('null left', solve([[4, None, [5]]]), [[4, 0, None, 5]])
    check('parent ordinal reset', solve([[4, [4], []], [5, [None], [6]]]), [[4, 0, 4, None], [5, 0, None, 6]])
    check('empty relation', solve([]), [])
    check('null right', solve([[4, [5], None]]), [[4, 0, 5, None]])
elif N == 5:
    check('longer left', solve([[5, [6, 7], [8]]]), [[5, 0, 6, 8], [5, 1, 7, None]])
    check('longer right', solve([[5, [6], [7, 8]]]), [[5, 0, 6, 7], [5, 1, None, 8]])
    check('empty both', solve([[5, [], None]]), [[5, None, None, None]])
    check('null left', solve([[5, None, [6]]]), [[5, 0, None, 6]])
    check('parent ordinal reset', solve([[5, [5], []], [6, [None], [7]]]), [[5, 0, 5, None], [6, 0, None, 7]])
    check('empty relation', solve([]), [])
    check('null right', solve([[5, [6], None]]), [[5, 0, 6, None]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Short left lists repeat their final element instead of null padding.

Zip two optional lists within each parent row using longest-list semantics and zero-based ordinals. Missing positions become None; two empty or null lists yield one outer placeholder with ordinal None.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,left,right in d:
            left=[] if left is None else left
            right=[] if right is None else right
            size=max(len(left),len(right))
            if size==0: out.append([ident,None,None,None])
            for i in range(size):
                a=left[i] if i<len(left) else None
                b=right[i] if i<len(right) else (right[0] if right else None)
                out.append([ident,i,a,b])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('longer left', solve([[1, [2, 3], [4]]]), [[1, 0, 2, 4], [1, 1, 3, None]])
    check('longer right', solve([[1, [2], [3, 4]]]), [[1, 0, 2, 3], [1, 1, None, 4]])
    check('empty both', solve([[1, [], None]]), [[1, None, None, None]])
    check('null left', solve([[1, None, [2]]]), [[1, 0, None, 2]])
    check('parent ordinal reset', solve([[1, [1], []], [2, [None], [3]]]), [[1, 0, 1, None], [2, 0, None, 3]])
    check('empty relation', solve([]), [])
    check('null right', solve([[1, [2], None]]), [[1, 0, 2, None]])
elif N == 2:
    check('longer left', solve([[2, [3, 4], [5]]]), [[2, 0, 3, 5], [2, 1, 4, None]])
    check('longer right', solve([[2, [3], [4, 5]]]), [[2, 0, 3, 4], [2, 1, None, 5]])
    check('empty both', solve([[2, [], None]]), [[2, None, None, None]])
    check('null left', solve([[2, None, [3]]]), [[2, 0, None, 3]])
    check('parent ordinal reset', solve([[2, [2], []], [3, [None], [4]]]), [[2, 0, 2, None], [3, 0, None, 4]])
    check('empty relation', solve([]), [])
    check('null right', solve([[2, [3], None]]), [[2, 0, 3, None]])
elif N == 3:
    check('longer left', solve([[3, [4, 5], [6]]]), [[3, 0, 4, 6], [3, 1, 5, None]])
    check('longer right', solve([[3, [4], [5, 6]]]), [[3, 0, 4, 5], [3, 1, None, 6]])
    check('empty both', solve([[3, [], None]]), [[3, None, None, None]])
    check('null left', solve([[3, None, [4]]]), [[3, 0, None, 4]])
    check('parent ordinal reset', solve([[3, [3], []], [4, [None], [5]]]), [[3, 0, 3, None], [4, 0, None, 5]])
    check('empty relation', solve([]), [])
    check('null right', solve([[3, [4], None]]), [[3, 0, 4, None]])
elif N == 4:
    check('longer left', solve([[4, [5, 6], [7]]]), [[4, 0, 5, 7], [4, 1, 6, None]])
    check('longer right', solve([[4, [5], [6, 7]]]), [[4, 0, 5, 6], [4, 1, None, 7]])
    check('empty both', solve([[4, [], None]]), [[4, None, None, None]])
    check('null left', solve([[4, None, [5]]]), [[4, 0, None, 5]])
    check('parent ordinal reset', solve([[4, [4], []], [5, [None], [6]]]), [[4, 0, 4, None], [5, 0, None, 6]])
    check('empty relation', solve([]), [])
    check('null right', solve([[4, [5], None]]), [[4, 0, 5, None]])
elif N == 5:
    check('longer left', solve([[5, [6, 7], [8]]]), [[5, 0, 6, 8], [5, 1, 7, None]])
    check('longer right', solve([[5, [6], [7, 8]]]), [[5, 0, 6, 7], [5, 1, None, 8]])
    check('empty both', solve([[5, [], None]]), [[5, None, None, None]])
    check('null left', solve([[5, None, [6]]]), [[5, 0, None, 6]])
    check('parent ordinal reset', solve([[5, [5], []], [6, [None], [7]]]), [[5, 0, 5, None], [6, 0, None, 7]])
    check('empty relation', solve([]), [])
    check('null right', solve([[5, [6], None]]), [[5, 0, 6, None]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,left,right in d:
            left=[] if left is None else left
            right=[] if right is None else right
            size=max(len(left),len(right))
            if size==0: out.append([ident,None,None,None])
            for i in range(size):
                a=left[i] if i<len(left) else None
                b=right[i] if i<len(right) else 0
                out.append([ident,i,a,b])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('longer left', solve([[1, [2, 3], [4]]]), [[1, 0, 2, 4], [1, 1, 3, None]])
    check('longer right', solve([[1, [2], [3, 4]]]), [[1, 0, 2, 3], [1, 1, None, 4]])
    check('empty both', solve([[1, [], None]]), [[1, None, None, None]])
    check('null left', solve([[1, None, [2]]]), [[1, 0, None, 2]])
    check('parent ordinal reset', solve([[1, [1], []], [2, [None], [3]]]), [[1, 0, 1, None], [2, 0, None, 3]])
    check('empty relation', solve([]), [])
    check('null right', solve([[1, [2], None]]), [[1, 0, 2, None]])
elif N == 2:
    check('longer left', solve([[2, [3, 4], [5]]]), [[2, 0, 3, 5], [2, 1, 4, None]])
    check('longer right', solve([[2, [3], [4, 5]]]), [[2, 0, 3, 4], [2, 1, None, 5]])
    check('empty both', solve([[2, [], None]]), [[2, None, None, None]])
    check('null left', solve([[2, None, [3]]]), [[2, 0, None, 3]])
    check('parent ordinal reset', solve([[2, [2], []], [3, [None], [4]]]), [[2, 0, 2, None], [3, 0, None, 4]])
    check('empty relation', solve([]), [])
    check('null right', solve([[2, [3], None]]), [[2, 0, 3, None]])
elif N == 3:
    check('longer left', solve([[3, [4, 5], [6]]]), [[3, 0, 4, 6], [3, 1, 5, None]])
    check('longer right', solve([[3, [4], [5, 6]]]), [[3, 0, 4, 5], [3, 1, None, 6]])
    check('empty both', solve([[3, [], None]]), [[3, None, None, None]])
    check('null left', solve([[3, None, [4]]]), [[3, 0, None, 4]])
    check('parent ordinal reset', solve([[3, [3], []], [4, [None], [5]]]), [[3, 0, 3, None], [4, 0, None, 5]])
    check('empty relation', solve([]), [])
    check('null right', solve([[3, [4], None]]), [[3, 0, 4, None]])
elif N == 4:
    check('longer left', solve([[4, [5, 6], [7]]]), [[4, 0, 5, 7], [4, 1, 6, None]])
    check('longer right', solve([[4, [5], [6, 7]]]), [[4, 0, 5, 6], [4, 1, None, 7]])
    check('empty both', solve([[4, [], None]]), [[4, None, None, None]])
    check('null left', solve([[4, None, [5]]]), [[4, 0, None, 5]])
    check('parent ordinal reset', solve([[4, [4], []], [5, [None], [6]]]), [[4, 0, 4, None], [5, 0, None, 6]])
    check('empty relation', solve([]), [])
    check('null right', solve([[4, [5], None]]), [[4, 0, 5, None]])
elif N == 5:
    check('longer left', solve([[5, [6, 7], [8]]]), [[5, 0, 6, 8], [5, 1, 7, None]])
    check('longer right', solve([[5, [6], [7, 8]]]), [[5, 0, 6, 7], [5, 1, None, 8]])
    check('empty both', solve([[5, [], None]]), [[5, None, None, None]])
    check('null left', solve([[5, None, [6]]]), [[5, 0, None, 6]])
    check('parent ordinal reset', solve([[5, [5], []], [6, [None], [7]]]), [[5, 0, 5, None], [6, 0, None, 7]])
    check('empty relation', solve([]), [])
    check('null right', solve([[5, [6], None]]), [[5, 0, 6, None]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Short right lists recycle their first element instead of null padding.

Zip two optional lists within each parent row using longest-list semantics and zero-based ordinals. Missing positions become None; two empty or null lists yield one outer placeholder with ordinal None.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,left,right in d:
            left=[] if left is None else left
            right=[] if right is None else right
            size=max(len(left),len(right))
            if size==0: out.append([ident,None,None,None])
            for i in range(size):
                a=left[i] if i<len(left) else None
                b=right[i] if i<len(right) else None
                out.append([ident,i,b,a])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('longer left', solve([[1, [2, 3], [4]]]), [[1, 0, 2, 4], [1, 1, 3, None]])
    check('longer right', solve([[1, [2], [3, 4]]]), [[1, 0, 2, 3], [1, 1, None, 4]])
    check('empty both', solve([[1, [], None]]), [[1, None, None, None]])
    check('null left', solve([[1, None, [2]]]), [[1, 0, None, 2]])
    check('parent ordinal reset', solve([[1, [1], []], [2, [None], [3]]]), [[1, 0, 1, None], [2, 0, None, 3]])
    check('empty relation', solve([]), [])
    check('null right', solve([[1, [2], None]]), [[1, 0, 2, None]])
elif N == 2:
    check('longer left', solve([[2, [3, 4], [5]]]), [[2, 0, 3, 5], [2, 1, 4, None]])
    check('longer right', solve([[2, [3], [4, 5]]]), [[2, 0, 3, 4], [2, 1, None, 5]])
    check('empty both', solve([[2, [], None]]), [[2, None, None, None]])
    check('null left', solve([[2, None, [3]]]), [[2, 0, None, 3]])
    check('parent ordinal reset', solve([[2, [2], []], [3, [None], [4]]]), [[2, 0, 2, None], [3, 0, None, 4]])
    check('empty relation', solve([]), [])
    check('null right', solve([[2, [3], None]]), [[2, 0, 3, None]])
elif N == 3:
    check('longer left', solve([[3, [4, 5], [6]]]), [[3, 0, 4, 6], [3, 1, 5, None]])
    check('longer right', solve([[3, [4], [5, 6]]]), [[3, 0, 4, 5], [3, 1, None, 6]])
    check('empty both', solve([[3, [], None]]), [[3, None, None, None]])
    check('null left', solve([[3, None, [4]]]), [[3, 0, None, 4]])
    check('parent ordinal reset', solve([[3, [3], []], [4, [None], [5]]]), [[3, 0, 3, None], [4, 0, None, 5]])
    check('empty relation', solve([]), [])
    check('null right', solve([[3, [4], None]]), [[3, 0, 4, None]])
elif N == 4:
    check('longer left', solve([[4, [5, 6], [7]]]), [[4, 0, 5, 7], [4, 1, 6, None]])
    check('longer right', solve([[4, [5], [6, 7]]]), [[4, 0, 5, 6], [4, 1, None, 7]])
    check('empty both', solve([[4, [], None]]), [[4, None, None, None]])
    check('null left', solve([[4, None, [5]]]), [[4, 0, None, 5]])
    check('parent ordinal reset', solve([[4, [4], []], [5, [None], [6]]]), [[4, 0, 4, None], [5, 0, None, 6]])
    check('empty relation', solve([]), [])
    check('null right', solve([[4, [5], None]]), [[4, 0, 5, None]])
elif N == 5:
    check('longer left', solve([[5, [6, 7], [8]]]), [[5, 0, 6, 8], [5, 1, 7, None]])
    check('longer right', solve([[5, [6], [7, 8]]]), [[5, 0, 6, 7], [5, 1, None, 8]])
    check('empty both', solve([[5, [], None]]), [[5, None, None, None]])
    check('null left', solve([[5, None, [6]]]), [[5, 0, None, 6]])
    check('parent ordinal reset', solve([[5, [5], []], [6, [None], [7]]]), [[5, 0, 5, None], [6, 0, None, 7]])
    check('empty relation', solve([]), [])
    check('null right', solve([[5, [6], None]]), [[5, 0, 6, None]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,left,right in d:
            left=[] if left is None else left
            right=[] if right is None else right
            size=max(len(left),len(right))
            if size==0: out.append([ident,None,None,None])
            for i in range(size):
                a=left[i] if i<len(left) else None
                b=right[i] if i<len(right) else None
                out.append([ident,i,a,a])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('longer left', solve([[1, [2, 3], [4]]]), [[1, 0, 2, 4], [1, 1, 3, None]])
    check('longer right', solve([[1, [2], [3, 4]]]), [[1, 0, 2, 3], [1, 1, None, 4]])
    check('empty both', solve([[1, [], None]]), [[1, None, None, None]])
    check('null left', solve([[1, None, [2]]]), [[1, 0, None, 2]])
    check('parent ordinal reset', solve([[1, [1], []], [2, [None], [3]]]), [[1, 0, 1, None], [2, 0, None, 3]])
    check('empty relation', solve([]), [])
    check('null right', solve([[1, [2], None]]), [[1, 0, 2, None]])
elif N == 2:
    check('longer left', solve([[2, [3, 4], [5]]]), [[2, 0, 3, 5], [2, 1, 4, None]])
    check('longer right', solve([[2, [3], [4, 5]]]), [[2, 0, 3, 4], [2, 1, None, 5]])
    check('empty both', solve([[2, [], None]]), [[2, None, None, None]])
    check('null left', solve([[2, None, [3]]]), [[2, 0, None, 3]])
    check('parent ordinal reset', solve([[2, [2], []], [3, [None], [4]]]), [[2, 0, 2, None], [3, 0, None, 4]])
    check('empty relation', solve([]), [])
    check('null right', solve([[2, [3], None]]), [[2, 0, 3, None]])
elif N == 3:
    check('longer left', solve([[3, [4, 5], [6]]]), [[3, 0, 4, 6], [3, 1, 5, None]])
    check('longer right', solve([[3, [4], [5, 6]]]), [[3, 0, 4, 5], [3, 1, None, 6]])
    check('empty both', solve([[3, [], None]]), [[3, None, None, None]])
    check('null left', solve([[3, None, [4]]]), [[3, 0, None, 4]])
    check('parent ordinal reset', solve([[3, [3], []], [4, [None], [5]]]), [[3, 0, 3, None], [4, 0, None, 5]])
    check('empty relation', solve([]), [])
    check('null right', solve([[3, [4], None]]), [[3, 0, 4, None]])
elif N == 4:
    check('longer left', solve([[4, [5, 6], [7]]]), [[4, 0, 5, 7], [4, 1, 6, None]])
    check('longer right', solve([[4, [5], [6, 7]]]), [[4, 0, 5, 6], [4, 1, None, 7]])
    check('empty both', solve([[4, [], None]]), [[4, None, None, None]])
    check('null left', solve([[4, None, [5]]]), [[4, 0, None, 5]])
    check('parent ordinal reset', solve([[4, [4], []], [5, [None], [6]]]), [[4, 0, 4, None], [5, 0, None, 6]])
    check('empty relation', solve([]), [])
    check('null right', solve([[4, [5], None]]), [[4, 0, 5, None]])
elif N == 5:
    check('longer left', solve([[5, [6, 7], [8]]]), [[5, 0, 6, 8], [5, 1, 7, None]])
    check('longer right', solve([[5, [6], [7, 8]]]), [[5, 0, 6, 7], [5, 1, None, 8]])
    check('empty both', solve([[5, [], None]]), [[5, None, None, None]])
    check('null left', solve([[5, None, [6]]]), [[5, 0, None, 6]])
    check('parent ordinal reset', solve([[5, [5], []], [6, [None], [7]]]), [[5, 0, 5, None], [6, 0, None, 7]])
    check('empty relation', solve([]), [])
    check('null right', solve([[5, [6], None]]), [[5, 0, 6, None]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Zip unnest swaps left and right child columns.

Zip two optional lists within each parent row using longest-list semantics and zero-based ordinals. Missing positions become None; two empty or null lists yield one outer placeholder with ordinal None.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,left,right in d:
            left=[] if left is None else left
            right=[] if right is None else right
            size=max(len(left),len(right))
            if size==0: out.append([ident,None,None,None])
            for i in range(size):
                a=left[i] if i<len(left) else None
                b=right[i] if i<len(right) else None
                out.append([ident,len(out),a,b])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('longer left', solve([[1, [2, 3], [4]]]), [[1, 0, 2, 4], [1, 1, 3, None]])
    check('longer right', solve([[1, [2], [3, 4]]]), [[1, 0, 2, 3], [1, 1, None, 4]])
    check('empty both', solve([[1, [], None]]), [[1, None, None, None]])
    check('null left', solve([[1, None, [2]]]), [[1, 0, None, 2]])
    check('parent ordinal reset', solve([[1, [1], []], [2, [None], [3]]]), [[1, 0, 1, None], [2, 0, None, 3]])
    check('empty relation', solve([]), [])
    check('null right', solve([[1, [2], None]]), [[1, 0, 2, None]])
elif N == 2:
    check('longer left', solve([[2, [3, 4], [5]]]), [[2, 0, 3, 5], [2, 1, 4, None]])
    check('longer right', solve([[2, [3], [4, 5]]]), [[2, 0, 3, 4], [2, 1, None, 5]])
    check('empty both', solve([[2, [], None]]), [[2, None, None, None]])
    check('null left', solve([[2, None, [3]]]), [[2, 0, None, 3]])
    check('parent ordinal reset', solve([[2, [2], []], [3, [None], [4]]]), [[2, 0, 2, None], [3, 0, None, 4]])
    check('empty relation', solve([]), [])
    check('null right', solve([[2, [3], None]]), [[2, 0, 3, None]])
elif N == 3:
    check('longer left', solve([[3, [4, 5], [6]]]), [[3, 0, 4, 6], [3, 1, 5, None]])
    check('longer right', solve([[3, [4], [5, 6]]]), [[3, 0, 4, 5], [3, 1, None, 6]])
    check('empty both', solve([[3, [], None]]), [[3, None, None, None]])
    check('null left', solve([[3, None, [4]]]), [[3, 0, None, 4]])
    check('parent ordinal reset', solve([[3, [3], []], [4, [None], [5]]]), [[3, 0, 3, None], [4, 0, None, 5]])
    check('empty relation', solve([]), [])
    check('null right', solve([[3, [4], None]]), [[3, 0, 4, None]])
elif N == 4:
    check('longer left', solve([[4, [5, 6], [7]]]), [[4, 0, 5, 7], [4, 1, 6, None]])
    check('longer right', solve([[4, [5], [6, 7]]]), [[4, 0, 5, 6], [4, 1, None, 7]])
    check('empty both', solve([[4, [], None]]), [[4, None, None, None]])
    check('null left', solve([[4, None, [5]]]), [[4, 0, None, 5]])
    check('parent ordinal reset', solve([[4, [4], []], [5, [None], [6]]]), [[4, 0, 4, None], [5, 0, None, 6]])
    check('empty relation', solve([]), [])
    check('null right', solve([[4, [5], None]]), [[4, 0, 5, None]])
elif N == 5:
    check('longer left', solve([[5, [6, 7], [8]]]), [[5, 0, 6, 8], [5, 1, 7, None]])
    check('longer right', solve([[5, [6], [7, 8]]]), [[5, 0, 6, 7], [5, 1, None, 8]])
    check('empty both', solve([[5, [], None]]), [[5, None, None, None]])
    check('null left', solve([[5, None, [6]]]), [[5, 0, None, 6]])
    check('parent ordinal reset', solve([[5, [5], []], [6, [None], [7]]]), [[5, 0, 5, None], [6, 0, None, 7]])
    check('empty relation', solve([]), [])
    check('null right', solve([[5, [6], None]]), [[5, 0, 6, None]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        out=[]
        for ident,left,right in d:
            left=[] if left is None else left
            right=[] if right is None else right
            size=max(len(left),len(right))
            if size==0: out.append([ident,None,None,None])
            for i in range(size):
                a=left[i] if i<len(left) else None
                b=right[i] if i<len(right) else None
                out.append([ident,i+1,a,b])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('longer left', solve([[1, [2, 3], [4]]]), [[1, 0, 2, 4], [1, 1, 3, None]])
    check('longer right', solve([[1, [2], [3, 4]]]), [[1, 0, 2, 3], [1, 1, None, 4]])
    check('empty both', solve([[1, [], None]]), [[1, None, None, None]])
    check('null left', solve([[1, None, [2]]]), [[1, 0, None, 2]])
    check('parent ordinal reset', solve([[1, [1], []], [2, [None], [3]]]), [[1, 0, 1, None], [2, 0, None, 3]])
    check('empty relation', solve([]), [])
    check('null right', solve([[1, [2], None]]), [[1, 0, 2, None]])
elif N == 2:
    check('longer left', solve([[2, [3, 4], [5]]]), [[2, 0, 3, 5], [2, 1, 4, None]])
    check('longer right', solve([[2, [3], [4, 5]]]), [[2, 0, 3, 4], [2, 1, None, 5]])
    check('empty both', solve([[2, [], None]]), [[2, None, None, None]])
    check('null left', solve([[2, None, [3]]]), [[2, 0, None, 3]])
    check('parent ordinal reset', solve([[2, [2], []], [3, [None], [4]]]), [[2, 0, 2, None], [3, 0, None, 4]])
    check('empty relation', solve([]), [])
    check('null right', solve([[2, [3], None]]), [[2, 0, 3, None]])
elif N == 3:
    check('longer left', solve([[3, [4, 5], [6]]]), [[3, 0, 4, 6], [3, 1, 5, None]])
    check('longer right', solve([[3, [4], [5, 6]]]), [[3, 0, 4, 5], [3, 1, None, 6]])
    check('empty both', solve([[3, [], None]]), [[3, None, None, None]])
    check('null left', solve([[3, None, [4]]]), [[3, 0, None, 4]])
    check('parent ordinal reset', solve([[3, [3], []], [4, [None], [5]]]), [[3, 0, 3, None], [4, 0, None, 5]])
    check('empty relation', solve([]), [])
    check('null right', solve([[3, [4], None]]), [[3, 0, 4, None]])
elif N == 4:
    check('longer left', solve([[4, [5, 6], [7]]]), [[4, 0, 5, 7], [4, 1, 6, None]])
    check('longer right', solve([[4, [5], [6, 7]]]), [[4, 0, 5, 6], [4, 1, None, 7]])
    check('empty both', solve([[4, [], None]]), [[4, None, None, None]])
    check('null left', solve([[4, None, [5]]]), [[4, 0, None, 5]])
    check('parent ordinal reset', solve([[4, [4], []], [5, [None], [6]]]), [[4, 0, 4, None], [5, 0, None, 6]])
    check('empty relation', solve([]), [])
    check('null right', solve([[4, [5], None]]), [[4, 0, 5, None]])
elif N == 5:
    check('longer left', solve([[5, [6, 7], [8]]]), [[5, 0, 6, 8], [5, 1, 7, None]])
    check('longer right', solve([[5, [6], [7, 8]]]), [[5, 0, 6, 7], [5, 1, None, 8]])
    check('empty both', solve([[5, [], None]]), [[5, None, None, None]])
    check('null left', solve([[5, None, [6]]]), [[5, 0, None, 6]])
    check('parent ordinal reset', solve([[5, [5], []], [6, [None], [7]]]), [[5, 0, 5, None], [6, 0, None, 7]])
    check('empty relation', solve([]), [])
    check('null right', solve([[5, [6], None]]), [[5, 0, 6, None]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Zip unnest exposes flattened output offsets as list ordinals.

Zip two optional lists within each parent row using longest-list semantics and zero-based ordinals. Missing positions become None; two empty or null lists yield one outer placeholder with ordinal None.

split: open-access