Python simple: 99% speed, 100% memory
\nout = []\ndirections = [[1,0],[0,1],[-1,0],[0,-1],[1,1],[-1,-1],[1,-1],[-1,1]]\nfor d in directions:\n\ti,j = king[0],king[1]\n\twhile 0<=i<=8 and 0<=j<=8:\n\
```\nout = []\ndirections = [[1,0],[0,1],[-1,0],[0,-1],[1,1],[-1,-1],[1,-1],[-1,1]]\nfor d in directions:\n\ti,j = king[0],king[1]\n\twhile 0<=i<=8 and 0<=j<=8:\n\t\ti += d[0]\n\t\tj += d[1]\n\t\tif [i,j] in queens:\n\t\t\tout.append([i,j])\n\t\t\tbreak\nreturn out\n```\n
['Python']