Skip to main content
added 3 characters in body
Source Link
user2390246
  • 1.5k
  • 7
  • 12

R, 3030 26 bytes

functioncat(a)all(abs(diff(ascan())<2^2<2))

Try it online!Try it online!

R, 30 bytes

function(a)all(abs(diff(a))<2)

Try it online!

R, 30 26 bytes

cat(all(diff(scan())^2<2))

Try it online!

Source Link
user2390246
  • 1.5k
  • 7
  • 12

R, 30 bytes

function(a)all(abs(diff(a))<2)

Try it online!