Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

1 of 4
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293

Python 3 (or Python 2), 153 bytes

lambda p,e=enumerate:[{sum(b[i+n%3-1][j+2*n%7%3-1]for n in range(8,16))for b,a in zip(p,p[1:])for i,r in e(b)for j,s in e(r)if s^d<a[i][j]}for d in(0,1)]

An unnamed function that accepts the pattern, p, and returns the minimal B and S as a list of two sets.

Try it online!

Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293

AltStyle によって変換されたページ (->オリジナル) /