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 Answer

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Edit: See Neil's answer Neil's answer for the fixed/completed version of the above code.

Edit: See Neil's answer for the fixed/completed version of the above code.

Edit: See Neil's answer for the fixed/completed version of the above code.

added link to Neil's answer
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

Edit: See Neil's answer for the fixed/completed version of the above code.

Edit: See Neil's answer for the fixed/completed version of the above code.

added 53-byte version from Neil
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

The valid bitmasks are the ones that have exactly two consecutive 1 transitions (the first and the last bitbits being considered as consecutive as well):

([a,b,c,d,e,f])=>!f&&a==e&&!(((a>b)+2*(b>c)+4*(c>d)+8*(d>e))%3)

Below is a 53-byte version suggested by Neil in the comments, which works (and fails) equally well:

([a,b,c,d,e,f])=>!f&&a==e&&!((a>b)-(b>c)+(c>d)-(d>e))

The valid bitmasks are the ones that have exactly two consecutive 1 transitions (the first and the last bit being considered as consecutive as well):

([a,b,c,d,e,f])=>!f&&a==e&&!(((a>b)+2*(b>c)+4*(c>d)+8*(d>e))%3)

The valid bitmasks are the ones that have exactly two consecutive 1 transitions (the first and the last bits being considered as consecutive as well):

([a,b,c,d,e,f])=>!f&&a==e&&!(((a>b)+2*(b>c)+4*(c>d)+8*(d>e))%3)

Below is a 53-byte version suggested by Neil in the comments, which works (and fails) equally well:

([a,b,c,d,e,f])=>!f&&a==e&&!((a>b)-(b>c)+(c>d)-(d>e))
saved 2 bytes
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading
improved description
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading
saved 2 bytes + added "how it works" section
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading
added old version with comment
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading
added 48 characters in body
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading
Post Undeleted by Arnauld
hopefully fixed for some special cases
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading
Post Deleted by Arnauld
saved 2 bytes
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670
Loading

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