Python short 3-line solution
\ndef minimumTeachings(self, n: int, ls: List[List[int]], es: List[List[int]]) -> int:\n\tls = [{0}]+[set(i) for i in ls]\n\tns = reduce(ior, [{i, j} for i, j i
```\ndef minimumTeachings(self, n: int, ls: List[List[int]], es: List[List[int]]) -> int:\n\tls = [{0}]+[set(i) for i in ls]\n\tns = reduce(ior, [{i, j} for i, j in es if not ls[i]&ls[j]] or [{0}]) # ns=={0} means no teaching is needed\n\treturn min(sum(i not in ls[k] for k in ns) for i in range(1, n+1)) if len(ns)>1 else 0\n```
[]