Skip to main content
1 of 7
digEmAll
  • 5k
  • 14
  • 22

R, 46 bytes

function(v)sign(diff(c(11,0,10,1:4*0,2:4)[v]))

Try it online!


If the input vector is not acceptable, then a possible 2-parameters alternative is :

R, 51 bytes

function(a,b,x=c(11,0,10,1:4*0,2:4))sign(x[a]-x[b])

Try it online!

digEmAll
  • 5k
  • 14
  • 22