Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
3 saved 2 bytes
source | link

JavaScript (ES6), 6262 60 bytes

a=> a.map(p=q=n=>n=> e&=!~(i=i+1p | q)<4|| q <(q=p)^ p <(p=n), i=e =e=p=q=~ 10)|e

Try it online!Try it online!

Code points:

61 3d 3e 20 61 2e 6d 61 70 28 70 3d 71 3d 6e 3d
  3e 20 65 26  
3d 2821 697e 3d28 6970 2b20 317c 2920 3c71 3429 7c 20
  71 20 3c 28  
71 3d 70 29 5e 20 70 20 3c 28 70 3d
  6e 29 2c 20 69
65 3d 6570 203d 71 3d 7e 20 3130 29 7c 65

JavaScript (ES6), 62 bytes

a=> a.map(p=q=n=> e&=(i=i+1)<4| q <(q=p)^ p <(p=n), i=e = 1)|e

Try it online!

Code points:

61 3d 3e 20 61 2e 6d 61 70 28 70 3d 71 3d 6e 3d
 3e 20 65 26 3d 28 69 3d 69 2b 31 29 3c 34 7c 20
 71 20 3c 28 71 3d 70 29 5e 20 70 20 3c 28 70 3d
 6e 29 2c 20 69 3d 65 20 3d 20 31 29 7c 65

JavaScript (ES6), 62 60 bytes

a=> a.map(n=> e&=!~(p | q)| q <(q=p)^ p <(p=n), e=p=q=~ 0)|e

Try it online!

Code points:

61 3d 3e 20 61 2e 6d 61 70 28 6e 3d 3e 20 65 26 
3d 21 7e 28 70 20 7c 20 71 29 7c 20 71 20 3c 28 
71 3d 70 29 5e 20 70 20 3c 28 70 3d 6e 29 2c 20
65 3d 70 3d 71 3d 7e 20 30 29 7c
    Post Undeleted by Arnauld
2 fixed version
source | link

JavaScript (ES6), 6062 bytes

  
a=> a.map(p=c=> o&= c!=p=q=n=> p&e&=(!si=i+1)<4| |s^(s=p<q <(p=cq=p)^ )p <(p=n) , o=1,s=0i=e = 1)|o|e

Try it online!Try it online!

Code points:

61 3d 3e 20 61 2e 6d 61 70 28 70 3d 71 3d 6e 3d
3e 20 65 26 3d 28 69 3d 69 2b 31 29 3c 34 7c 20
71 20 3c 28 71 3d 70 29 5e 20 70 20 3c 28 70 3d
6e 29 2c 20 69 3d 65 20 3d 20 31 29 7c 65

JavaScript (ES6), 60 bytes

 
a=> a.map(p=c=> o&= c!= p&(!s |s^(s=p<(p=c) ) ) , o=1,s=0)|o

Try it online!

JavaScript (ES6), 62 bytes

 
a=> a.map(p=q=n=> e&=(i=i+1)<4| q <(q=p)^ p <(p=n), i=e = 1)|e

Try it online!

Code points:

61 3d 3e 20 61 2e 6d 61 70 28 70 3d 71 3d 6e 3d
3e 20 65 26 3d 28 69 3d 69 2b 31 29 3c 34 7c 20
71 20 3c 28 71 3d 70 29 5e 20 70 20 3c 28 70 3d
6e 29 2c 20 69 3d 65 20 3d 20 31 29 7c 65
    Post Deleted by Arnauld
1
source | link

JavaScript (ES6), 60 bytes

a=> a.map(p=c=> o&= c!= p&(!s |s^(s=p<(p=c) ) ) , o=1,s=0)|o

Try it online!