Skip to main content
edited body
Source Link
Jakube
  • 22k
  • 3
  • 28
  • 108

Pyth, 17 16 bytes

.e-.|f}k@QTUQYkQ 

Try it online: Demonstration or +"Q.e-.|f}k@QTUQYkQ&input="Test+Cases:"[][[0]][[],[0,1]][[0,1],[]][[0,1],[0],[1,0,3],[]][[3],[],[5],[3],[1,3],[4]][[0,1],[6],[],[3],[3],[1],[4,2]][[6],[0,5,1],[5,4],[3,5],[4],[5,6],[0,3]][[1,0],[5,1],[5],[1],[5,7],[7,1],[],[1]][[2,8,0,9],[5,2,3,4],[0,2],[3,7,4],[8,1,2],[5,1,9,2],[6,9],[6,5,2,9,0],[9,1,2,0],[3,9]]&debug=0" rel="nofollow noreferrer">Test Suite

Explanation

 implicit: Q = input .e Q enumerated mapping of Q (k index, Y out-neighbors): f UQ filter [0, 1, ..., len(Q)-1] for elements T, which satisfy: }k@QT k in Q[T] # this are the in-neighbors .| Y setwise union with Y - k remove k 

Pyth, 17 16 bytes

.e-.|f}k@QTUQbkQ 

Try it online: Demonstration or +"Q.e-.|f}k@QTUQbkQ&input="Test+Cases:"[][[0]][[],[0,1]][[0,1],[]][[0,1],[0],[1,0,3],[]][[3],[],[5],[3],[1,3],[4]][[0,1],[6],[],[3],[3],[1],[4,2]][[6],[0,5,1],[5,4],[3,5],[4],[5,6],[0,3]][[1,0],[5,1],[5],[1],[5,7],[7,1],[],[1]][[2,8,0,9],[5,2,3,4],[0,2],[3,7,4],[8,1,2],[5,1,9,2],[6,9],[6,5,2,9,0],[9,1,2,0],[3,9]]&debug=0" rel="nofollow noreferrer">Test Suite

Explanation

 implicit: Q = input .e Q enumerated mapping of Q (k index, b out-neighbors): f UQ filter [0, 1, ..., len(Q)-1] for elements T, which satisfy: }k@QT k in Q[T] # this are the in-neighbors .| b setwise union with b - k remove k 
deleted 74 characters in body
Source Link
Jakube
  • 22k
  • 3
  • 28
  • 108

Pyth, 17 bytes

.e-+-f}k@QTUQYYkQ 

Try it online: Demonstration or +"Q.e-+-f}k@QTUQYYkQ&input="Test+Cases:"[][[0]][[],[0,1]][[0,1],[]][[0,1],[0],[1,0,3],[]][[3],[],[5],[3],[1,3],[4]][[0,1],[6],[],[3],[3],[1],[4,2]][[6],[0,5,1],[5,4],[3,5],[4],[5,6],[0,3]][[1,0],[5,1],[5],[1],[5,7],[7,1],[],[1]][[2,8,0,9],[5,2,3,4],[0,2],[3,7,4],[8,1,2],[5,1,9,2],[6,9],[6,5,2,9,0],[9,1,2,0],[3,9]]&debug=0" rel="nofollow noreferrer">Test Suite

Explanation

  implicit: Q = input .e  Q enumerated mapping of Q (k index, Y out-neighbors): f UQ  filter [0, 1, ..., len(Q)-1] for elements T, which satisfy: }k@QT  k in Q[T]   # this are the in-neighbors   - Y  remove all elements of Y +  Y  add all elements of Y -  k remove k  

Pyth, 17 16 bytes

.e-.|f}k@QTUQYkQ 

Try it online: Demonstration or +"Q.e-.|f}k@QTUQYkQ&input="Test+Cases:"[][[0]][[],[0,1]][[0,1],[]][[0,1],[0],[1,0,3],[]][[3],[],[5],[3],[1,3],[4]][[0,1],[6],[],[3],[3],[1],[4,2]][[6],[0,5,1],[5,4],[3,5],[4],[5,6],[0,3]][[1,0],[5,1],[5],[1],[5,7],[7,1],[],[1]][[2,8,0,9],[5,2,3,4],[0,2],[3,7,4],[8,1,2],[5,1,9,2],[6,9],[6,5,2,9,0],[9,1,2,0],[3,9]]&debug=0" rel="nofollow noreferrer">Test Suite

Explanation

 implicit: Q = input .e Q enumerated mapping of Q (k index, Y out-neighbors): f UQ filter [0, 1, ..., len(Q)-1] for elements T, which satisfy: }k@QT k in Q[T] # this are the in-neighbors .| Y setwise union with Y - k remove k 
added 3 characters in body
Source Link
Jakube
  • 22k
  • 3
  • 28
  • 108

Pyth, 17 bytes

.e-+-f}k@QTUQYYkQ 

Try it online: Demonstration or +"Q.e-+-f}k@QTUQYYkQ&input="Test+Cases:"[][[0]][[],[0,1]][[0,1],[]][[0,1],[0],[1,0,3],[]][[3],[],[5],[3],[1,3],[4]][[0,1],[6],[],[3],[3],[1],[4,2]][[6],[0,5,1],[5,4],[3,5],[4],[5,6],[0,3]][[1,0],[5,1],[5],[1],[5,7],[7,1],[],[1]][[2,8,0,9],[5,2,3,4],[0,2],[3,7,4],[8,1,2],[5,1,9,2],[6,9],[6,5,2,9,0],[9,1,2,0],[3,9]]&debug=0" rel="nofollow noreferrer">Test Suite

Explanation

  implicit: Q = input .e Q enumerated mapmapping of Q (k index, Y out-neighbors): f UQ filter [0, 1, ..., len(Q)-1] for elements T, which satisfy: }k@QT k in Q[T] # this are the in-neighbors - Y remove all elements of Y + Y add all elements of Y - k remove k 

Pyth, 17 bytes

.e-+-f}k@QTUQYYkQ 

Try it online: Demonstration or +"Q.e-+-f}k@QTUQYYkQ&input="Test+Cases:"[][[0]][[],[0,1]][[0,1],[]][[0,1],[0],[1,0,3],[]][[3],[],[5],[3],[1,3],[4]][[0,1],[6],[],[3],[3],[1],[4,2]][[6],[0,5,1],[5,4],[3,5],[4],[5,6],[0,3]][[1,0],[5,1],[5],[1],[5,7],[7,1],[],[1]][[2,8,0,9],[5,2,3,4],[0,2],[3,7,4],[8,1,2],[5,1,9,2],[6,9],[6,5,2,9,0],[9,1,2,0],[3,9]]&debug=0" rel="nofollow noreferrer">Test Suite

Explanation

  implicit: Q = input .e Q enumerated map of Q (k index, Y out-neighbors): f UQ filter [0, 1, ..., len(Q)-1] for elements T, which satisfy: }k@QT k in Q[T] # this are the in-neighbors - Y remove all elements of Y + Y add all elements of Y - k remove k 

Pyth, 17 bytes

.e-+-f}k@QTUQYYkQ 

Try it online: Demonstration or +"Q.e-+-f}k@QTUQYYkQ&input="Test+Cases:"[][[0]][[],[0,1]][[0,1],[]][[0,1],[0],[1,0,3],[]][[3],[],[5],[3],[1,3],[4]][[0,1],[6],[],[3],[3],[1],[4,2]][[6],[0,5,1],[5,4],[3,5],[4],[5,6],[0,3]][[1,0],[5,1],[5],[1],[5,7],[7,1],[],[1]][[2,8,0,9],[5,2,3,4],[0,2],[3,7,4],[8,1,2],[5,1,9,2],[6,9],[6,5,2,9,0],[9,1,2,0],[3,9]]&debug=0" rel="nofollow noreferrer">Test Suite

Explanation

 implicit: Q = input .e Q enumerated mapping of Q (k index, Y out-neighbors): f UQ filter [0, 1, ..., len(Q)-1] for elements T, which satisfy: }k@QT k in Q[T] # this are the in-neighbors - Y remove all elements of Y + Y add all elements of Y - k remove k 
Source Link
Jakube
  • 22k
  • 3
  • 28
  • 108
Loading