Skip to main content
Commonmark migration
Source Link

#Java 8, 60 bytes

Java 8, 60 bytes

n->(n-~new Long((n+"").replaceAll(".","8"))+"").substring(1) 

Port of @edc65's amazing JavaScript (ES6) answer, since I doubt it can be done shorter in an arithmetic way in Java.

Try it here.

#Java 8, 60 bytes

n->(n-~new Long((n+"").replaceAll(".","8"))+"").substring(1) 

Port of @edc65's amazing JavaScript (ES6) answer, since I doubt it can be done shorter in an arithmetic way in Java.

Try it here.

Java 8, 60 bytes

n->(n-~new Long((n+"").replaceAll(".","8"))+"").substring(1) 

Port of @edc65's amazing JavaScript (ES6) answer, since I doubt it can be done shorter in an arithmetic way in Java.

Try it here.

Source Link
Kevin Cruijssen
  • 136.3k
  • 14
  • 155
  • 394

#Java 8, 60 bytes

n->(n-~new Long((n+"").replaceAll(".","8"))+"").substring(1) 

Port of @edc65's amazing JavaScript (ES6) answer, since I doubt it can be done shorter in an arithmetic way in Java.

Try it here.