2 saved 3 bytes
source | link

JavaScript (ES6), 133130 bytes

Takes input as two arrays of digits in currying syntax (a)(b). Returns a boolean.

a=>b=>a.some((_,i)=>a.some((_,j)=>i-j&&!(A=a.map((v,i)=>Math.abs(v-b[i])).some((_,j,[...b])=>i-j&&!b.some(v=>v-b[~kA[~k--]-1,bA.splice(i,0,bA.splice(j,1)[k=0]))))

Try it online!Try it online!

JavaScript (ES6), 133 bytes

Takes input as two arrays of digits in currying syntax (a)(b). Returns a boolean.

a=>b=>a.some((_,i)=>a.map((v,i)=>Math.abs(v-b[i])).some((_,j,[...b])=>i-j&&!b.some(v=>v-b[~k--]-1,b.splice(i,0,b.splice(j,1)[k=0]))))

Try it online!

JavaScript (ES6), 130 bytes

Takes input as two arrays of digits in currying syntax (a)(b). Returns a boolean.

a=>b=>a.some((_,i)=>a.some((_,j)=>i-j&&!(A=a.map((v,i)=>Math.abs(v-b[i]))).some(v=>v-A[~k--]-1,A.splice(i,0,A.splice(j,1)[k=0]))))

Try it online!

1
source | link

JavaScript (ES6), 133 bytes

Takes input as two arrays of digits in currying syntax (a)(b). Returns a boolean.

a=>b=>a.some((_,i)=>a.map((v,i)=>Math.abs(v-b[i])).some((_,j,[...b])=>i-j&&!b.some(v=>v-b[~k--]-1,b.splice(i,0,b.splice(j,1)[k=0]))))

Try it online!