Skip to main content
-1
Source Link
ngn
  • 15.3k
  • 2
  • 43
  • 87

APL (Dyalog Unicode), 3333 32 bytesSBCS

{⍺h⍵+1h⍵+1 0}+h←(,≡30⊢≡31 31|,30|⊢)×21 2∨.≥⊢,-\

Try it online!Try it online!

in: ⍺=smaller, ⍵=largera pair in descending order

out: 2=ongoing, 1=ended, 0=invalid

tests stolen from Adám's answer

APL (Dyalog Unicode), 33 bytesSBCS

{⍺h⍵+1}+h←(,≡30 31|,)×21 2∨.≥⊢,-

Try it online!

in: ⍺=smaller, ⍵=larger

out: 2=ongoing, 1=ended, 0=invalid

tests stolen from Adám's answer

APL (Dyalog Unicode), 33 32 bytesSBCS

{h⍵+1 0}+h←(⊢≡31 30|⊢)×21 2∨.-\

Try it online!

in: a pair in descending order

out: 2=ongoing, 1=ended, 0=invalid

tests stolen from Adám's answer

Source Link
ngn
  • 15.3k
  • 2
  • 43
  • 87

APL (Dyalog Unicode), 33 bytesSBCS

{⍺h⍵+1}+h←(,≡30 31|,)×21 2∨.≥⊢,-⍨

Try it online!

in: ⍺=smaller, ⍵=larger

out: 2=ongoing, 1=ended, 0=invalid

tests stolen from Adám's answer