4 added 44 characters in body
source | link

JavaScript (ES6), 31 29 2828 22 bytes

s=>(15-parseInt(`0x${s,16)%15}`%15)%15

Port of @xnor's Python answer, except that JavaScript only has a remainder operator rather than a modulo operator, so I can't do it in a single step. Edit: Saved 6 bytes thanks to @Arnauld.

JavaScript (ES6), 31 29 28 bytes

s=>(15-parseInt(s,16)%15)%15

Port of @xnor's Python answer, except that JavaScript only has a remainder operator rather than a modulo operator, so I can't do it in a single step.

JavaScript (ES6), 31 29 28 22 bytes

s=>(15-`0x${s}`%15)%15

Port of @xnor's Python answer, except that JavaScript only has a remainder operator rather than a modulo operator, so I can't do it in a single step. Edit: Saved 6 bytes thanks to @Arnauld.

3 added 64 characters in body
source | link

JavaScript (ES6), 31 2929 28 bytes

s=>[...s].maps=>(c=>r15-=cparseInt(s,r=4516)|r%15)%15

Just subtracts all the supplied digits from 45. Edit: 2 boring bytes saved by @ETHproductionsPort of @xnor's Python answer, except that JavaScript only has a remainder operator rather than a modulo operator, so I can't do it in a single step.

JavaScript (ES6), 31 29 bytes

s=>[...s].map(c=>r-=c,r=45)|r

Just subtracts all the supplied digits from 45. Edit: 2 boring bytes saved by @ETHproductions.

JavaScript (ES6), 31 29 28 bytes

s=>(15-parseInt(s,16)%15)%15

Port of @xnor's Python answer, except that JavaScript only has a remainder operator rather than a modulo operator, so I can't do it in a single step.

2 added 55 characters in body
source | link

JavaScript (ES6), 3131 29 bytes

s=>[...s].reduce(map(r,c)=>rc=>r-c=c,45r=45)|r

Just subtracts all the supplied digits from 45. Edit: 2 boring bytes saved by @ETHproductions.

JavaScript (ES6), 31 bytes

s=>[...s].reduce((r,c)=>r-c,45)

Just subtracts all the supplied digits from 45.

JavaScript (ES6), 31 29 bytes

s=>[...s].map(c=>r-=c,r=45)|r

Just subtracts all the supplied digits from 45. Edit: 2 boring bytes saved by @ETHproductions.

1
source | link