# Return to Answer

9 added 8 characters in body

# Python 2, 116119 106 bytes

Thanks Mr. Xcoder for the 116->84 cut, but I found I have missed the "consecutive number" criteria, so 26 bytes are added for that purpose :(

After that, -1 more Thanks Mr. Xcoder, and -13 Thanks ovs

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];print sum(e>f for e,f in zip(l,l[1:]))==1==len(l)-max(l)+min(l)


Try it online!

That one below fixes 25634 - 11111 problem but with double length (211 206 145B145 142B)... Golfing...

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];r=[l[i]-i-min(l)for i in range(len(l))];print (sum(r)==0and ==0)&(len([x for x in r if abs(x)>1])<2and any<2)&any(r)


And congratulations to new moderators :)

Explanation:

l=[abs(x-y)for x,y in zip(a,b)]


Generates the list of absolute differences of the digits.

r=[l[i]-i-min(l)for i in range(len(l))]


Calculates the offset from the proper position.

sum(r)==0


If the sequence is not continuous, then offset sum will "usually" not be 0. But even if it equals 0, the next ones will block them out.

len([x for x in r if abs(x)>1])<2


Only 0 or 1 item will have absolute offset larger than 1 (the one with wrong position, and 0 is in the case like 1,2,3,5,4)

any(r)


Blocks the case when the numbers are all in correct positions

# Python 2, 116119 106 bytes

Thanks Mr. Xcoder for the 116->84 cut, but I found I have missed the "consecutive number" criteria, so 26 bytes are added for that purpose :(

After that, -1 more Thanks Mr. Xcoder, and -13 Thanks ovs

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];print sum(e>f for e,f in zip(l,l[1:]))==1==len(l)-max(l)+min(l)


Try it online!

That one below fixes 25634 - 11111 problem but with double length (211 206 145B)... Golfing...

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];r=[l[i]-i-min(l)for i in range(len(l))];print sum(r)==0and len([x for x in r if abs(x)>1])<2and any(r)


Try it online!

And congratulations to new moderators :)

Explanation:

l=[abs(x-y)for x,y in zip(a,b)]


Generates the list of absolute differences of the digits.

r=[l[i]-i-min(l)for i in range(len(l))]


Calculates the offset from the proper position.

sum(r)==0


If the sequence is not continuous, then offset sum will "usually" not be 0. But even if it equals 0, the next ones will block them out.

len([x for x in r if abs(x)>1])<2


Only 0 or 1 item will have absolute offset larger than 1 (the one with wrong position, and 0 is in the case like 1,2,3,5,4)

any(r)


Blocks the case when the numbers are all in correct positions

# Python 2, 116119 106 bytes

Thanks Mr. Xcoder for the 116->84 cut, but I found I have missed the "consecutive number" criteria, so 26 bytes are added for that purpose :(

After that, -1 more Thanks Mr. Xcoder, and -13 Thanks ovs

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];print sum(e>f for e,f in zip(l,l[1:]))==1==len(l)-max(l)+min(l)


Try it online!

That one below fixes 25634 - 11111 problem but with double length (211 206 145 142B)... Golfing...

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];r=[l[i]-i-min(l)for i in range(len(l))];print(sum(r)==0)&(len([x for x in r if abs(x)>1])<2)&any(r)


Try it online!

And congratulations to new moderators :)

Explanation:

l=[abs(x-y)for x,y in zip(a,b)]


Generates the list of absolute differences of the digits.

r=[l[i]-i-min(l)for i in range(len(l))]


Calculates the offset from the proper position.

sum(r)==0


If the sequence is not continuous, then offset sum will "usually" not be 0. But even if it equals 0, the next ones will block them out.

len([x for x in r if abs(x)>1])<2


Only 0 or 1 item will have absolute offset larger than 1 (the one with wrong position, and 0 is in the case like 1,2,3,5,4)

any(r)


Blocks the case when the numbers are all in correct positions

8 added 536 characters in body

# Python 2, 116119 106 bytes

Thanks Mr. Xcoder for the 116->84 cut, but I found I have missed the "consecutive number" criteria, so 26 bytes are added for that purpose :(

After that, -1 more Thanks Mr. Xcoder, and -13 Thanks ovs

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];print sum(e>f for e,f in zip(l,l[1:]))==1==len(l)-max(l)+min(l)


Try it online!

That one below fixes 25634 - 11111 problem but with double length (211 206 145B)... Golfing...

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];r=[l[i]-i-min(l)for i in range(len(l))];print sum(r)==0and len([x for x in r if abs(x)>1])<2and any(r)


Try it online!

And congratulations to new moderators :)

Explanation:

l=[abs(x-y)for x,y in zip(a,b)]


Generates the list of absolute differences of the digits.

r=[l[i]-i-min(l)for i in range(len(l))]


Calculates the offset from the proper position.

sum(r)==0


If the sequence is not continuous, then offset sum will "usually" not be 0. But even if it equals 0, the next ones will block them out.

len([x for x in r if abs(x)>1])<2


Only 0 or 1 item will have absolute offset larger than 1 (the one with wrong position, and 0 is in the case like 1,2,3,5,4)

any(r)


Blocks the case when the numbers are all in correct positions

# Python 2, 116119 106 bytes

Thanks Mr. Xcoder for the 116->84 cut, but I found I have missed the "consecutive number" criteria, so 26 bytes are added for that purpose :(

After that, -1 more Thanks Mr. Xcoder, and -13 Thanks ovs

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];print sum(e>f for e,f in zip(l,l[1:]))==1==len(l)-max(l)+min(l)


Try it online!

That one below fixes 25634 - 11111 problem but with double length (211 206 145B)... Golfing...

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];r=[l[i]-i-min(l)for i in range(len(l))];print sum(r)==0and len([x for x in r if abs(x)>1])<2and any(r)


Try it online!

And congratulations to new moderators :)

# Python 2, 116119 106 bytes

Thanks Mr. Xcoder for the 116->84 cut, but I found I have missed the "consecutive number" criteria, so 26 bytes are added for that purpose :(

After that, -1 more Thanks Mr. Xcoder, and -13 Thanks ovs

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];print sum(e>f for e,f in zip(l,l[1:]))==1==len(l)-max(l)+min(l)


Try it online!

That one below fixes 25634 - 11111 problem but with double length (211 206 145B)... Golfing...

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];r=[l[i]-i-min(l)for i in range(len(l))];print sum(r)==0and len([x for x in r if abs(x)>1])<2and any(r)


Try it online!

And congratulations to new moderators :)

Explanation:

l=[abs(x-y)for x,y in zip(a,b)]


Generates the list of absolute differences of the digits.

r=[l[i]-i-min(l)for i in range(len(l))]


Calculates the offset from the proper position.

sum(r)==0


If the sequence is not continuous, then offset sum will "usually" not be 0. But even if it equals 0, the next ones will block them out.

len([x for x in r if abs(x)>1])<2


Only 0 or 1 item will have absolute offset larger than 1 (the one with wrong position, and 0 is in the case like 1,2,3,5,4)

any(r)


Blocks the case when the numbers are all in correct positions

7 deleted 101 characters in body

# Python 2, 116119 106 bytes

Thanks Mr. Xcoder for the 116->84 cut, but I found I have missed the "consecutive number" criteria, so 26 bytes are added for that purpose :(

After that, -1 more Thanks Mr. Xcoder, and -13 Thanks ovs

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];print sum(e>f for e,f in zip(l,l[1:]))==1==len(l)-max(l)+min(l)


Try it online!

That one below fixes 25634 - 11111 problem but with double length (211 206B206 145B)... Golfing...

def m(a,b,f=lambda x,n:x[:n]+x[n+1:]):l=[absl=[abs(x-y)forfor x,y in zip(a,b)];z=len];r=[l[i]-i-min(l);o=10**z/9;printfor any((int("".joini in range(flen(l,i)[:j]+[l[i]]+f(l,i)[j:]))-o**2/10**z];print sum(r)%o==0and==0and i-jlen([x for jx in range(z-1)for ir inif rangeabs(zx)>1])<2and any(r)


And congratulations to new moderators :)

# Python 2, 116119 106 bytes

Thanks Mr. Xcoder for the 116->84 cut, but I found I have missed the "consecutive number" criteria, so 26 bytes are added for that purpose :(

After that, -1 more Thanks Mr. Xcoder, and -13 Thanks ovs

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];print sum(e>f for e,f in zip(l,l[1:]))==1==len(l)-max(l)+min(l)


Try it online!

That one below fixes 25634 - 11111 problem but with double length (211 206B)... Golfing...

def m(a,b,f=lambda x,n:x[:n]+x[n+1:]):l=[abs(x-y)for x,y in zip(a,b)];z=len(l);o=10**z/9;print any((int("".join(f(l,i)[:j]+[l[i]]+f(l,i)[j:]))-o**2/10**z)%o==0and i-j for j in range(z-1)for i in range(z))


Try it online!

And congratulations to new moderators :)

# Python 2, 116119 106 bytes

Thanks Mr. Xcoder for the 116->84 cut, but I found I have missed the "consecutive number" criteria, so 26 bytes are added for that purpose :(

After that, -1 more Thanks Mr. Xcoder, and -13 Thanks ovs

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];print sum(e>f for e,f in zip(l,l[1:]))==1==len(l)-max(l)+min(l)


Try it online!

That one below fixes 25634 - 11111 problem but with double length (211 206 145B)... Golfing...

def m(a,b):l=[abs(x-y)for x,y in zip(a,b)];r=[l[i]-i-min(l)for i in range(len(l))];print sum(r)==0and len([x for x in r if abs(x)>1])<2and any(r)


Try it online!

And congratulations to new moderators :)

6 added 850 characters in body; added 2 characters in body
5 added 850 characters in body; added 2 characters in body
4 deleted 2 characters in body
3 added 43 characters in body
2 added 237 characters in body; edited body; added 5 characters in body; added 44 characters in body
1