Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

deleted 40 characters in body
Source Link
Robert S.
  • 1.3k
  • 11
  • 17

R, (削除) 133 (削除ここまで) (削除) 117 (削除ここまで) 93(削除) 93 (削除ここまで) 76 bytes

-16 bytes thanks to JayCe. -2441 bytes thanks to Giuseppe.

forx=scan(i in 10:107);while({x=i%F=F+any((D=T%/%10^(1:nchar(iT)-1)%%10;`if`(all(x%%10)!=rev(x)),F<-c(F,iD));F<=x}
cat(F[scan()+1])T=T+1;T

Try it online! Try it online!

R, (削除) 133 (削除ここまで) (削除) 117 (削除ここまで) 93 bytes

-16 bytes thanks to JayCe. -24 bytes thanks to Giuseppe.

for(i in 10:107){x=i%/%10^(1:nchar(i)-1)%%10;`if`(all(x!=rev(x)),F<-c(F,i))}
cat(F[scan()+1])

Try it online!

R, (削除) 133 (削除ここまで) (削除) 117 (削除ここまで) (削除) 93 (削除ここまで) 76 bytes

-16 bytes thanks to JayCe. -41 bytes thanks to Giuseppe.

x=scan();while({F=F+any((D=T%/%10^(1:nchar(T)-1)%%10)!=rev(D));F<=x})T=T+1;T

Try it online!

deleted 107 characters in body
Source Link
Robert S.
  • 1.3k
  • 11
  • 17

R, (削除) 133 (削除ここまで) 117(削除) 117 (削除ここまで) 93 bytes

-16 bytes thanks to JayCe. -24 bytes thanks to Giuseppe.

for(i in 10:107)if(i!=as.numeric(paste(rev(el(strsplit{x=i%/%10^(as.character1:nchar(i),""-1)%%10;`if`(all(x!=rev(x)),collapse="")))F<-c(F,i))}
cat(F[scan()+1])

Try it online!

I always go down the string manipulation route for these types of things and I need to break that habit.Try it online!

R, (削除) 133 (削除ここまで) 117 bytes

-16 bytes thanks to JayCe.

for(i in 10:107)if(i!=as.numeric(paste(rev(el(strsplit(as.character(i),""))),collapse="")))F<-c(F,i)
cat(F[scan()+1])

Try it online!

I always go down the string manipulation route for these types of things and I need to break that habit.

R, (削除) 133 (削除ここまで) (削除) 117 (削除ここまで) 93 bytes

-16 bytes thanks to JayCe. -24 bytes thanks to Giuseppe.

for(i in 10:107){x=i%/%10^(1:nchar(i)-1)%%10;`if`(all(x!=rev(x)),F<-c(F,i))}
cat(F[scan()+1])

Try it online!

added 3 characters in body
Source Link
Robert S.
  • 1.3k
  • 11
  • 17

R, 133(削除) 133 (削除ここまで) 117 bytes

-16 bytes thanks to JayCe.

x=c();
for(i in (010:97)+10107){`if`if(i!=as.numeric(paste(rev(el(strsplit(as.character(i),"")[[1]])),collapse="")),x<)F<-c(xF,i))}
pastecat(x[scanF[scan()]+1])

Try it online! Try it online!

I always go down the string manipulation route for these types of things and I need to break that habit.

R, 133 bytes

x=c();
for(i in (0:97)+10){`if`(i!=as.numeric(paste(rev(strsplit(as.character(i),"")[[1]]),collapse="")),x<-c(x,i))}
paste(x[scan()])

Try it online!

I always go down the string manipulation route for these types of things and I need to break that habit.

R, (削除) 133 (削除ここまで) 117 bytes

-16 bytes thanks to JayCe.

for(i in 10:107)if(i!=as.numeric(paste(rev(el(strsplit(as.character(i),""))),collapse="")))F<-c(F,i)
cat(F[scan()+1])

Try it online!

I always go down the string manipulation route for these types of things and I need to break that habit.

edited body
Source Link
Robert S.
  • 1.3k
  • 11
  • 17
Loading
Source Link
Robert S.
  • 1.3k
  • 11
  • 17
Loading

AltStyle によって変換されたページ (->オリジナル) /