Skip to main content
deleted 4 characters in body
Source Link
pajonk
  • 18.3k
  • 3
  • 25
  • 74

R, 28 2624 bytes

\(d)sum((d*c(1:7,-1)))%%11

Attempt This Online!Attempt This Online!

Takes input as a vector of digits. Outputs swapped truthy (non-zero) / falsy (zero).

R, 28 26 bytes

\(d)sum((d*c(1:7,-1)))%%11

Attempt This Online!

Takes input as a vector of digits. Outputs swapped truthy (non-zero) / falsy (zero).

R, 28 24 bytes

\(d)sum(d*c(1:7,-1))%%11

Attempt This Online!

Takes input as a vector of digits. Outputs swapped truthy (non-zero) / falsy (zero).

added 54 characters in body
Source Link
pajonk
  • 18.3k
  • 3
  • 25
  • 74

R, 2828 26 bytes

\(d)sum(d[-8]*1(d*c(1:7,-1)%%11==d[8]))%%11

Attempt This Online!Attempt This Online!

Takes input as a vector of digits. Outputs swapped truthy (non-zero) / falsy (zero).

R, 28 bytes

\(d)sum(d[-8]*1:7)%%11==d[8]

Attempt This Online!

Takes input as a vector of digits.

R, 28 26 bytes

\(d)sum((d*c(1:7,-1)))%%11

Attempt This Online!

Takes input as a vector of digits. Outputs swapped truthy (non-zero) / falsy (zero).

Source Link
pajonk
  • 18.3k
  • 3
  • 25
  • 74

R, 28 bytes

\(d)sum(d[-8]*1:7)%%11==d[8]

Attempt This Online!

Takes input as a vector of digits.