Skip to main content
rewrote the code
Source Link

JavaScript (Node.js), 7591 - 50% = 46 bytes

n=processn=BigInt(process.argv[2])
f=x=>(x/10|010n|0n)-2*2n*(x%10x%10n)
while(n>70n>70n){n=f(n)}
console.log(nn+'')

Ran the code in VS Code with command line input, and tested all the provided test cases. Doesn't doAdded support for long integers, so noclaiming 50% bonus.

JavaScript (Node.js), 75 bytes

n=process.argv[2]
f=x=>(x/10|0)-2*(x%10)
while(n>70){n=f(n)}
console.log(n)

Ran the code in VS Code with command line input, and tested all the provided test cases. Doesn't do long integers, so no bonus.

JavaScript (Node.js), 91 - 50% = 46 bytes

n=BigInt(process.argv[2])
f=x=>(x/10n|0n)-2n*(x%10n)
while(n>70n){n=f(n)}
console.log(n+'')

Ran the code in VS Code with command line input, and tested all the provided test cases. Added support for long integers, so claiming 50% bonus.

Source Link

JavaScript (Node.js), 75 bytes

n=process.argv[2]
f=x=>(x/10|0)-2*(x%10)
while(n>70){n=f(n)}
console.log(n)

Ran the code in VS Code with command line input, and tested all the provided test cases. Doesn't do long integers, so no bonus.