[Question]
  [
We have some new ~~sheriffs~~ moderators in town, [Mego](https://codegolf.stackexchange.com/users/45941/mego) and [DJMcMayhem](https://codegolf.stackexchange.com/users/31716/djmcmayhem). We need a challenge to properly honour them for their new positions, so there we go. 
Here's something that has caught my attention when hovering over their profiles – their user IDs are \$31716\$ and \$45941\$. If you perform digit-wise subtraction, you'll notice something pretty exciting (of course, taking the absolute differences):
```
3|1|7|1|6
4|5|9|4|1
-+-+-+-+- (-)
1|4|2|3|5
```
The number generated by the above algorithm is \$14235\$. There is something special about this integer: It consists of *consecutive* digits only, sorted in ascending order, but *exactly one* of the digits is not placed correctly — \$4\$. 
We will call a pair of positive integers \$(a, b)\$ a *DJMcMego pair* if the digit-wise absolute differences are consecutive integers, sorted in ascending order, but exactly one of them is not where it belongs. That is, it is possible to move *exactly one* digit of the result of digit-wise subtraction to another position, such that the integer obtained only has consecutive digits, sorted in ascending order. 
In our example above, the pair \$(31716, 45941)\$ is a *DJMcMego* pair, because if \$4\$ is moved between \$3\$ and \$5\$, the result is \$12345\$, which fulfils the criteria. Note that the digits of the resulting number **do not** need to start at \$1\$, they just ought to be consecutive. When one is unsure about what decision they should make, they can always rely on the other's help to sort things out. 
Your task is to output a [truthy/falsy value](https://codegolf.meta.stackexchange.com/a/2194/59487) depending on whether a pair of positive integers given as input is a DJMcMego pair.
* You are guaranteed that \$a\$ and \$b\$ will have the same number of digits, always at least 4.
* You can take the integers in any reasonable format (i.e. native integers, strings, lists of digits, etc.)
* You can compete in any [programming language](https://codegolf.meta.stackexchange.com/a/2073/59487) and can take input and provide output through any [standard method](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods), while taking note that [these loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden by default. This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest submission (in bytes) for *every language* wins.
## Test cases
```
a, b -> Output
31716, 45941 -> Truthy
12354, 11111 -> Truthy
56798, 22222 -> Truthy
23564, 11111 -> Truthy
1759,  2435  -> Truthy
12345, 11111 -> Falsy
3333,  2101  -> Falsy
22354, 22222 -> Falsy
31717, 45941 -> Falsy
14325, 11111 -> Falsy
89789, 78865 -> Falsy
14954, 61713 -> Falsy
25631, 11114 -> Falsy
```
Or, in another [format](https://tio.run/##VY7NDsIgEITP8hSEE0RipPw36ZOohzatkUSRCAd9@rrY1OhwgW92dkivcrlHOc@5I4RIYYXhWGmvBBKN1IpjUYW0sd5x3FQhMMzXEVZ7MJTUNaH0yiUIuNgL1CyblnDtsGuH89ZB2jpnIK58HTMwIOEzCJ3vDxxwiDjvcrqGQskxEtaiTY87HA5t2IU4Tk9KOGEntBk@9BdumxZ4eoRY6DXkQm99ovDgPWP8DwwA8pS62sCnONZLPYTN8xs).
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 18 bytes
```
αDæIg<ùʒD{Q}gĀ*{¥P
```
[Try it online!](https://tio.run/##MzBNTDJM/f//3EaXw8s8020O7zw1yaU6sDb9SINW9aGlAf//RxvqmOgY6xjpmMZyAdlQGAsA "05AB1E – Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~259~~ ~~258~~ ~~254~~ ~~253~~ ~~250~~ ~~248~~ ~~233~~ 222 bytes
* Thanks to [Stan Strum](https://codegolf.stackexchange.com/users/63757/stan-strum) for inspring a one byte golf.
* Saved four bytes by juggling some variable initializations.
* Saved a byte by golfing `for(...;l++)b*=B[l]==-~B[l-1];` to `for(...;b*=B[l]==-~B[~-l++]);` (most likely relying on undefined behaviour, as it requires first evaluating `B[l]` followed by `-~B[~-l++]`).
* Saved ~~three~~ five bytes.
* Saved ~~fifteen~~ twenty-six bytes thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat).
```
j,k,l,L,r,b;f(char*A,char*B){for(j=r=0;k=A[L=j];)A[j++]=-~abs(A[j]-B[j]);for(;k-L;k++)for(j=~0;L-++j;r|=!b)if(k-j)for(bcopy(B-~l,strcpy(B,A)+l,strlen(A+l)),bcopy(B+j,B-~j,L+~j),B[j]=A[k],l=b=0;B[++l];b|=B[l]+~B[~-l]);A=r;}
```
[Try it online!](https://tio.run/##ddHdToMwFAfwa30KbGLS2kNSNhiQpjHtvm54A@RioOgKTsN2Y3S8@mzLDDfSC@gJ/1/Ooa3816q6XDQ00EIGHZS8xtXbrnuQ4F6KfNcfHdaiE4w3QuaZ0AUnMteUFsLvd@URm6LwlXkQbrO88TPeUEoG2DOe@ZRq3v2Iu5Lsa9z42n0rq4/PL6z8voXjqavsHiShrmpfDljSlhC4pqgGk9SQ0V4TsN3MME0BrSjNZCqntC14@SNU3ha0V3nvt2YeKTp@vrzv9gdMvm9v7C95kuWFQPMgDhYIZGCLMErDAPHPbn841RjdP3uPwgueDghqLJkJEcKvWjkdzOZRiEA5Hdg1oRUzoVEvnY4WcZogWDo9s2tCL5kJjXo19I6jFHmwGnQ4j5D3v14xExr1@m/yMEKwnp6cDXrNTGjUG6eTNE5SBBun4yRZRBN6w0xo1Nuhd5jaU9s6vTAXMJ/QW2ZCVp8vvw "C (gcc) – Try It Online")
# Explanation (248 byte version)
```
j,k,l,L,r,b;                            // global variables
f(char*A,char*B){                       // function takes two strings
 for(j=r=0;A[j];L=j)                    // loop through A, compute array length L
  A[j++]=-~abs(A[j]-B[j]);              // set every entry in A to the absolute
                                        // difference of A and B at that position
                                        /* Test out all possible movements of        *
                                         * characters and see if any one             *
                                         * results in a sorted list => DJMcMego pair */
 for(j=0;j-L;j++)                       // loop through array
  for(k=~0;L-++k;r|=!b)                 // loop through array
   if(j-k){                             // j is not equal to k
    for(l=0;A[l];B[l++]=A[l]);          // copy A to B
    for(l=j;A[l];B[~-l]=B[++l]);        // shift part of B
    for(l=L;l-k;B[-~l]=B[--l]);         // shift part of B
    B[k]=A[j];                          // insert character at correct position
    for(l=b=0;B[++l];b|=B[l]+~B[~-l]);} // test if B is sorted
 A=r;}                                  // return if there was a DJMcMego pair found
```
[Try it online!](https://tio.run/##lZTfb9owEMefx19xizSJQKKGQvihKJuS0laa6NveGA9OcCCJiZnttEJt@dfZOWkL7ZaJ@cEJyn2@d777mthexfHhkFm5xayZJazIg3@siwtYMR4RBvdEpCRiVLaSdrwmohNY1SM0H5vZpCxilfICFMmpBPXAQSqRFivZgoSLduYL3/GCebbwZn5mNqgwzreg1oKXqzUEFsR8sy0VBSIE2QGjxUqtYdYCQKFud@HbexLJtla1Q9xM7w9FSRXQeyp2QAuFe1pAAIpjElSNJGco34IzF@ot0yShghYxBZ6gFCmWEAJRKIjblstUd@F8xQ78oFIBLxUQxrSATLH3sOH3dIMlS53mZXXOloUO6JGRWFEhqxolpZAm@LoDXtD3sf8jK6gsGVaFfSQguVB0CSzFE/hfYfr9Lr6jKw5bkgroXLxO3vEye@bhwMzmvr6bfDVurErjub93vJnd7eaeePI/R@bZNJ63ndl5o2vf6AxSCQVHo/wq0f/ojrxqiU7PKteyhRfOmXacfj@1GeIx3@5qU4UnWPaK7W228MN5t3sKameu0wQdQ4TSIz5FZx6zcyTtfUXa9ruUDWg4z3V1eL/@eda0kBSxN3do68ZcCBp/cG9dSoTHr2v3oieshS26@/pIpves9ZR2Lxor1D2s/dCCwBf49ZzrJKgqRaEF8EIKCg8E7frBSAkvi@VhQ9KibT62PunSIXDmC9/o90a9oWEFPf1j4E4GPcPb4p@OStrGlyV886H3szCspB04GGSa3gsdVnTvsu8ODCus6J5eDXToYNCRvqpodziajA3rqqIv9WqgrxwMOtLTOvfInRhgTWt60HcN@Ds9dTDoSF@/Vj5wDeu6uXKnpq8dDDrSNxU9nozGE8O6qejReDx0G@gbB4OO9G2dezDRXbut6CEOoN9A3zoYpOnnw28 "C (gcc) – Try It Online")
[Answer]
# 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!](https://tio.run/##hZBNb4MwDIbv/Iru0iaSg5ry2UOQuOy2224ITSmjaygtqGFIu@yvMweoxjY0ZBHh5PFr@y1kK3V2U3XDrtVr3h1FJ0V0EJG0dXXJCXkBRadZgZlixXr9QGIh7YusCWl75kk2J1seNGnZIVEppXQoakXUsjj5PDOWMg6xretSZTlRsP1OCuA0OYutKaNdVl11VeZ2Wb2RTfJ8e29OH@mGWtP7I0kc4BDg56eUJC54sAcXOEr8BjnswMF314AcxpgBPfBRcQ@hAXcwxgw46PnLimZCHCxdrXpF19SZhFrWzy0fZannlhxmx@2WOjnQx70TR3v50OnP7BM3/lvy7m@w5G@ILwHgaUDzE6I13qwbLqJja3@UdxDsvgA "JavaScript (Node.js) – Try It Online")
[Answer]
# SWI-Prolog, 157 bytes
Not very short but the problem seemed particularly well-suited for declarative predicates, variable binding and recursion, i.e., Prolog :)
```
n(T,Y):-s(T,Q,I,J),s(Y,W,I,J),m(Q,W).
s(T,Q,I,J):-nth0(I,T,X,R),nth0(J,Q,X,R),I\=J.
m([A,B|T],[C,D|Y]):-1 is abs(B-D)-abs(A-C),m([B|T],[D|Y]).
m([_],[_]).
```
Call with, e.g., `n([3,1,7,1,6],[4,5,9,4,1]).`
Explanation: move an element in both lists to a new position (using the SWI-Prolog `nth0` built-in) and check if the difference of the new lists is consecutive.
```
s(T,Q,I,J)    % switch (yet unbounded) index I and J in list T, store in Q
s(Y,W,I,J)    % switch (now bounded) I and J in list Y
m(Q,W)        % check new lists
s(T,Q,I,J) :- nth0(I,T,X,R) % X (unbounded) is the I-th (unbounded) element 
                            % of list T with rest R (=prefix+postfix) 
nth0(J,Q,X,R) % the same X is the J-th element in list Q with the same rest R
I\=J          % I and J are unequal
m([A,B|T],[C,D|Y]) :-  % consider first two elements of both lists
1 is abs(B-D)-abs(A-C) % check if differences are consecutive                          
m([B|T],[D|Y])         % recursion starting with the second element
m([_],[_]).            % stop recursion at last element in the list
```
[Answer]
# [J](http://jsoftware.com/), 27 bytes
−8 bytes thanks to FrownyFrog 
```
1"0(-:(2-/\|\:|),1#.2>/\|)-
```
[Try it online!](https://tio.run/##bU@7DoMwDNz5ihMdAIlQEgihkdqlUqdOndmqRlWX/gD/nh4JUPUhy07s89nnh0@rzGFvkaFEDUsXFY6X88nLtM6FzZXYDuNgx6KUm0odmBTCFwmS2/X@RAMJQ@/g0EJjxyhnTEIR16w4/heLmCbDsLsnplaLWGR1f3nTtmlLoLWh8WPbpOGX1czmwCbJGyXWXW@N3zqW28yf23pmJkQX3p569aqkZT3O7OYZjX8B "J – Try It Online")
## Initial solution:
# [J](http://jsoftware.com/), 35 bytes
```
[:((1=[:*/2-/\\:~)*1=1#.0<2-/\])|@-
```
[Try it online!](https://tio.run/##bU@7DsIwDNz7FScY@hB9uG2aElEJCYmJiZUyISLEwg8gfj04SVsEVJad2Oezz3ezyEKNTiHECgUUe5phdzzszUlFEXUnleRlmve9esUJdbTMio3Nz/Fzm5o4QHC93B6oQJDsDTRqCKw50oARSsYFVzT/R/OYYIbk7paxcjKPeVYzy7Pb7BZHq13j1zar4Z9VDabBTcS3EqZdH42/Osbb5MxtLWfSRe3elvWKSUnNdT@zGWZUMG8 "J – Try It Online")
## Explanation
Takes lists of digits as input
`|@-` finds the absolute difference between the digits of the lists
`1=1#.0<2-/\]` Checks if only one digits is out of its place. First I find the differences between all pairs of adjacent digits and check to see if only one of them is positive.
`*` Multiply the result from the above test (1 or 0) with the following test:
`1=[:*/2-/\\:~` Are all digits consecutive? I sort the list down, take the differences for all pairs of adjacent digits, multiply them and check if it equals 1
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 14 bytes
```
ạµṢ_JEċ@Œ¿-Ƥ%L
```
[Try it online!](https://tio.run/##VY49CkIxEIR7T7GNXUQ3yeans1AE8QYhWNnIu4CtrZ03UAQbWwtthOfPPZ4XiQl5ihm2Guab2eWiqlYhNNddfW4u@/l0/NgMn9v61nsdurMwuh/77/Up3iQE55xAjYqBJCvRsw6AQy5IMsCk7JDS1jDgSdmJEVVmADVZBsCloJaKRb9MslyqllRiIiphOGgdnuf/xtKLunxRCl72GKtNnNfGKPpmbOpRERZtMymBmZLe@w8 "Jelly – Try It Online")
### How it works
```
ạµṢ_JEċ@Œ¿-Ƥ%L  Main link. Arguments: A, B (digit arrays)
ạ               Take the elementwise absolute difference. Call the result R.
 µ              New chain. Argument: R
  Ṣ             Sort R.
    J           Indices; yield [1, ..., len(R)].
   _            Take the elementwise difference.
     E          Test if all differences are equal.
                The result is 1 if R consists of consecutive digits, 0 otherwise.
          -Ƥ    For all outfixes of R, generated by dropping one of its elements:
        Œ¿        Get its permutation index (1 if sorted, higher if not).
      ċ@        Count the number of times the Boolean from the left appears in the
                array to the right. If the Boolean is 1, the count represents the
                number of ways a single digit can be deleted to yield a sorted
                array. The count has to be positive for a DJMcMego pair, but less
                than the length of R, since R may not be sorted.
            %L  Take the result modulo len(R), mapping len(R) to 0.
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 18 bytes
> 
> Been debating whether I should post this or not for a couple of hours. Came up with it quickly late last night but didn't have time to test it properly (*and* I thought it might be too long!). Oliver has since posted a [similar solution](https://codegolf.stackexchange.com/a/156535/58974) (which was, when this one was originally posted, invalid) so if he, or the community, feels this is *too* similar, I'll happily delete it.
> 
> 
> 
Takes input as 2 digit arrays, outputs `0` for `true` or any other number for `false`.
```
íaV
ä> x*Un än × É
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.5&code=7WFWCuQ+IHgqVW4g5G4g1yDJ&input=WzEsMiwzLDQsNV0sWzEsMSwxLDEsMV0=) or [check all test cases](https://ethproductions.github.io/japt/?v=1.4.5&code=rsztYVpnCq7kPiB4KlpuIORuINcgyQ==&input=WwpbWzMsMSw3LDEsNl0sWzQsNSw5LDQsMV1dLApbWzEsMiwzLDUsNF0sWzEsMSwxLDEsMV1dLApbWzUsNiw3LDksOF0sWzIsMiwyLDIsMl1dLApbWzIsMyw1LDYsNF0sWzEsMSwxLDEsMV1dLApbWzEsNyw1LDldLFsyLDQsMyw1XV0sCltbMSwyLDMsNCw1XSxbMSwxLDEsMSwxXV0sCltbMywzLDMsM10sWzIsMSwwLDFdXSwKW1syLDIsMyw1LDRdLFsyLDIsMiwyLDJdXSwKW1szLDEsNywxLDddLFs0LDUsOSw0LDFdXSwKW1s4LDksNyw4LDldLFs3LDgsOCw2LDVdXSwKW1sxLDQsOSw1LDRdLFs2LDEsNywxLDNdXQpdCi1R)
---
## Explanation
```
                   :Implicit input of digit arrays U and V               :[3,1,7,1,6],[4,5,9,4,1]
í V                :Interleave V with U                                  :[[3,4],[1,5],[7,9],[1,4],[6,1]]
 a                 :Get the absolute difference of each pair             :[1,4,2,3,5]
\n                 :Assign that new array to variable U
ä>                 :Is each element greater than the next?               :[false,true,false,false]
     Un            :Sort U                                               :[1,2,3,4,5]
        än         :Get the deltas                                       :[1,1,1,1]
           ×       :Reduce by multiplication                             :1
    *              :Multiply each element in the boolean array by that   :[0,1,0,0]
   x               :Reduce by addition                                   :1
             É     :Subtract 1                                           :0
```
And, to walk through that process on a few more test cases:
```
---------------------------------------------------------------
| U   | [2,3,5,6,4] | [1,2,3,4,5] | [3,1,7,1,7] | [1,4,9,5,4] |
| V   | [1,1,1,1,1] | [1,1,1,1,1] | [4,5,9,4,1] | [6,1,7,1,3] |
|-----|-------------|-------------|-------------|-------------|
| íaV | [1,2,4,5,3] | [0,1,2,3,4] | [1,4,2,3,6] | [5,3,2,4,1] |
|-----|-------------|-------------|-------------|-------------|
| ä>  | [F,F,F,T]   | [F,F,F,F]   | [F,T,F,F]   | [T,T,F,T]   |
|-----|-------------|-------------|-------------|-------------|
| Un  | [1,2,3,4,5] | [0,1,2,3,4] | [1,2,3,4,6] | [1,2,3,4,5] |
| än  | [1,1,1,1]   | [1,1,1,1]   | [1,1,1,2]   | [1,1,1,1]   |
| ×   | 1           | 1           | 2           | 1           |
|-----|-------------|-------------|-------------|-------------|
| *   | [0,0,0,1]   | [0,0,0,0]   | [0,2,0,0]   | [1,1,0,1]   |
| x   | 1           | 0           | 2           | 3           |
| É   | 0           | -1          | 1           | 2           |
---------------------------------------------------------------
```
[Answer]
# Perl, ~~121~~ 118 bytes
```
($a,$b)=map[split//],@ARGV;
$s+=$l>$_,$l=$_ for@c=map abs($$a[$i]-$$b[$i++]),@$a;
@c=sort@c;
say$s==1&&$c[-1]-$c[0]==$#$a
```
Test in bash:
```
function golf {
   perl -E'($a,$b)=map[split//],@ARGV;$s+=$l>$_,$l=$_ for@c=map abs($$a[$i]-$$b[$i++]),@$a;@c=sort@c;say$s==1&&$c[-1]-$c[0]==$#$a' $1 $2
}
golf 31716 45941       #says 1, true
golf 12354 11111       #says 1, true
golf 56798 22222       #says 1, true
golf 46798 22222       #says nothing, false
golf 22354 22222       #says nothing, false
golf 1759 2435         #says 1, true
golf 12345 11111       #says nothing, false
golf 89789 78865       #says nothing, false
golf 14954 61713       #says nothing, false
```
[Answer]
# [Java 8](http://www.oracle.com/technetwork/java/javase/overview/java8-2100321.html), ~~245~~ ~~227~~ ~~223~~ ~~194~~ 188 Bytes
### Thanks to Kevin for saving ~29 bytes
### Thanks to Kevin again for another 6 bytes
```
 z->{int l=z.length/2,c[]=new int[l],i=0,j=0;for(;i<l;)c[i]=Math.abs(z[i]-z[i+++l]);java.util.Arrays.sort(z=c.clone());for(i=0;i<l-1;j+=z[i]-z[i-1]!=1?1:0)j+=c[i]-c[++i]>0?1:0;return j==1;}
```
Followed the same pattern Galen came up with for his J answer.
[Try it online!](https://tio.run/##pdTNbqMwEADge55i9obFz0L@yK7XXeUBeuoRcXCok5p1gdqmUYjy7FnjUJqUS1CRhcDAN@PxiJy@U7@sWJE//ztX9UbwDDJBlYJHyguA42QC5uCFZnJLMwZrMwXdsSlLwWgB1DHPkxQahO2z0@Ujpak23BookHPjPxzNWyBIEwhW7PTLz6mXJSkp2L7lE5F6nIReTkK8LaWD@R@BUZbwlDxS/RLQjXIac@ebk@u6IkU4N7kHteYiWEtJDypQpdROQ7IgE2XBHISsZNQW8yOcu@SD8KP0B4n@Rr9DZGbbMH6WuC5PH8J2Ekuma1lATkiET2c86dfc1ahb23vJn@HVVMp50pIXO1MEKncKXRXpUpo3IHCceRB5ENvz0oO5BwsPftmL6IT7L54OSrPXoKx1UBlUi8LRsmZACNCAOm8I4S/6vtUNOvVgZtG5jfE57tf3Q521@sKmHNt8VzbS57hfZ0Ndtnqf@PI7ucuhrrvKxB@1ntoAbbD7XT10DzcVv@zkiKy3VKiePwz5umuXfkytGo6D6yHMu2pfd8qIvbzh@ZAvv7Z5PKrNb/hyyFctv7JYbNuwv1jZ1lmM4Kshr7pNnVv4Upzl1WJmI3iF@p/h6fwf "Java (OpenJDK 8) – Try It Online")
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), 102 bytes
```
+`(.)(.*¶)(.)(.*)
$2$4;$1,$3
\d
*
(_*),\1
_
L$w`(;_+\b)(.*)(;_+\b)
$%`$2$3$1$%"$3$1$2$'
m`(^;_+|\1_)+$
```
[Try it online!](https://tio.run/##PY09DsIwDIV3n6JCrkjaqML5j7gCG2tFA4KBAQaExMK5OAAXKw6lvMXWe@@zb6f7@bqnsRbbrKqxzaKTomveLzktElCjXSMpNNAfoQExNFL1BANs8JHFemj7w7f5WwHrzIxBwnrxHRqXcMlix/mzp0G2OI6GAnlVWZcsAWnjrKqoCJwPKapKFwEH/p9QcIkDa1whrJt9w2KfVgR6ujTB5UeYf8QUItMhRs@4TaXmuWA@ "Retina – Try It Online") Link includes test cases. Returns the number of ways digits can be moved to achieve an ascending sequence, which is 2 for a straight swap since either digit can be moved past the other in that case. Explanation:
```
+`(.)(.*¶)(.)(.*)
$2$4;$1,$3
```
Pair up the digits.
```
\d
*
```
Convert to unary.
```
(_*),\1
_
```
Take the difference, but then add 1 because working with zero in Retina is hard™.
```
L$w`(;_+\b)(.*)(;_+\b)
$%`$2$3$1$%"$3$1$2$'
```
List all the sequences of digits obtained by moving exactly one digit.
```
m`(^;_+|\1_)+$
```
Check for consecutive digits.
[Answer]
# [Perl 5](https://www.perl.org/), -F ~~87~~ ~~84~~ 83 bytes
Old style counting: 86 bytes (`+3` for `-F`)
Give he numbers as 2 lines on STDIN, the last line without a trailing newline.
Prints the difference string up to 2 times for true, nothing for false
The long `A0123456789` string is really annoying.
```
#!/usr/bin/perl -F
$_=<>;s%.%abs$&-$F[pos]%eg;s%%"'$`$''=~s:|:A0123456789=~/\$`$&\$'/>//&&say:reg"%eeg
```
[Try it online!](https://tio.run/##DcndCoIwGADQ@54i5Nt25X5y05xN6MaXyCiDMYJow68ugvDRW96ek/z8MPmNfmu4klx2GS7u0HdIOJluCLSE4ZQinokPK5KCwRUYcwvarz1Ktau0qZt96xYxrkNHYKIXglKcPnb2oSDeh5wr1ah6o02r1S@m1z0@MZfDHw "Perl 5 – Try It Online")
I'm usure if this `79` counts as valid:
```
$_=<>;s%.%abs$&-$F[pos]%eg;s,,$a=$&;"$`$'"=~s:|:A0123456789=~/$`$a$'/%//:reg,eg
```
It crashes for a valid pair, so you get a non zero exit code. It does nothing if not a pair and exits with exit code 0. I know returning the result via exit code is allowed, but are they properly truthy and falsy or in fact reversed (for the shell `0` is true) ?
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~124 113 99~~ 95 bytes
```
->l,b,d=-1{m=l.map!{|i|(i-b[d+=1]).abs}.sort;l.any?{|*i|m-i==l-i}&&m!=l&&/#{m*''}/=~[*0..9]*''}
```
[Try it online!](https://tio.run/##dVHtboIwFP3vU1w1YepKtUD52FJ9EEKWItV1ATG0LDPAXp2BbnNidv7c9Jyee89tizI@tTvWmusUxShhJqkyluKMH8dVLeuZNOMweWQkmmMeqwarvNDPKeaH06aqF7LOTMlYasrGMLIxSw1jOa2yxcNDs2Sf4WKFcRD1p/ZYagUTeTjXX@xz3RfxcRRbLZLJKBwBhKFNPOIicGjgkAiBLkoBETpLxLKpg4D0GEjU9QIfgdVjIHUm9x8X8WiAACzHpnA/y6FX146nSnxLdofeRVYEBpJ1SfgT48bV7eVd9/or@YHndzk833fpQCJO0Dd0O7M9nEVd2xkmHEVY8O0rJDnUM44gniMo6u7@5Q@mFcc6f1E4fSuVBreBaRXfMua642a7kONE7qVWuBDvolACxQMi2vTv9XSeO7/rWjSTkTgk7Rc "Ruby – Try It Online")
[Answer]
# [Pyt](https://github.com/mudkip201/pyt), ~~20~~ 18 [bytes](https://github.com/mudkip201/pyt/wiki/Codepage)
```
ą←ą-ÅĐʁ>Ʃ1=⇹ş₋Π1=∧
```
[Try it online!](https://tio.run/##K6gs@f//SOujtglHWnUPtx6ZcKrR7thKQ9tH7TuPzn/U1H1uAZDdsfz/f2NDc0MzLhNTSxNDAA)
Explanation:
```
       Implicitly get the first number
ą      Convert to list of digits
←      Get the second number
ą      Convert to list of digits
-Å     Take the absolute value of the differences of the lists element-wise
Đ      Duplicate the list of differences
ʁ>     Reduce by greater than
Ʃ1=    Is the sum of that array equal to 1
⇹      Swap the top two items on the stack
ş      Sort the top of the stack ascending
₋      Reduce by subtraction (from the right)
Π1=    Is the product of the array equal to 1
∧      bitwise-AND (in this case, also logical AND) the top two items on the stack
       Implicit print
```
[Answer]
# [Add++](https://github.com/cairdcoinheringaahing/AddPlusPlus), 105 bytes
```
D,w,@~,Ñ_€|BSVcGbU1b]2b]+º=
D,k,@,BPB*
L,BcB_€|B]dBkbUBSVcGbU£>sVcGB]VBKB#BKBcB_0º>b]GBK{w}b]++b*1=BK{k}*
```
[Try it online!](https://tio.run/##bY@9asMwFIXn6ikU2snR4Gv9p8QYYciQDoGSbKJUMWTwEuiQQpsOfYM@Q9c@QUb3Tfoi7nXkxh56QCB9nHPv0WNV7fdtW7IDK97Y98fDz/vXq7vfbBdhDcFnwU@b05yUrGYFcyuXkDvmti7afOXqsO7dzWf@hBfnN27prvGgK21OefALt3w5HHHSNCQwx0d9THDjjhXFjLkS/GRCyM0upxw0KJpTIa0AenVL4Ywh41Ighk4DlkpbgzjrNGA0q3/coKWliGkmuIyYPM9SsiJ/O4Qcp9LYCBVTkI5w1je6rE4v/fW4f8TGamMRa2OUHDAIex6iMMVHs6Xi0DcRIzdwHQviBzra/gI "Add++ – Try It Online")
Defines a lambda function that takes two lists of digits as input. Outputs a positive integer divisible by **24**1 for DJMcMego pairs, **0** otherwise.
1: If this is too restrictive, it also outputs a positive integer for DJMcMego pairs, and **0** otherwise
## How it works
Here we perform 4 checks to determine if the input is valid. The parts of the code that do those checks are
```
BcB_€|B]dBkbUBSVcGbU£>sVcGB]V
```
Here, we take the list of absolute digit differences, then count the number of overlapping pairs which are sorted in descending order. Every DJMcMego pair produces a result of **1**, but they are not unique in this aspect. We also store the inputs' absolute digit differences, to save bytes later. This array will be referred to as **A** throughout.
```
BKB#BKBcB_0º>b]
```
Next, we take the elementwise differences between **A** and **A** sorted, before asserting that at least one of those differences is negative.
```
D,w,@~,Ñ_€|BSVcGbU1b]2b]+º=
GBK{w}b]
```
Third, we check if the pair **[1, 2]** is contained in the forward increments of **A**. This checks that, in at least one position of **A**, it is sorted, which is a criterion for DJMcMego pairs.
```
D,k,@,BPB*
BK{k}
```
As our last check, we assert that the second element of **A** is never **0**. In order for a pair, **X** and **Y**, to be a DJMcMego pair, we can assume that their **A** is always unique, as an array with duplicates in it can never be made consecutive by swapping a single value with another.
Finally, we check that the first three of these tests returned **1**, and that the fourth returned a value **x** such that **x ≠ 0**
A step for step walk through of the code is as follows
```
D,w,		; Define a function **w**;
		;   This takes an array of integers
		;   Returns whether the pair [1, 2] appears in the absolute forward differences
		;
	@	; Take one argument
	~,	; Splat that argument to the stack
		;   Example argument:		[1 4 2 3 5]
		;
	Ñ_	; Increments;		STACK = [3 -2 1 2]
	€|	; Magnitudes;		STACK = [3 2 1 2]
	BSVcGbU	; Overlapping pairs;	STACK = [[3 2] [2 1] [1 2]]
	1b]2b]+	; Push [1 2];		STACK = [[3 2] [2 1] [1 2] [1 2]]
	º=	; Any equal [1 2];	STACK = [1]
; ============= ;
D,k,		; Define a function **k**;
		;   This function takes an array of integers
		;   Returns whether the second element is **0**;
		;
	@,	; Take one argument and push to the stack
		;   Example argument:		[[1 4 2 3 5]]
		;
	BP	; Behead;		STACK = [[4 2 3 5]] 
	B*	; Product;		STACK = [120]
		;
		; In DJMcMego pairs, **A** may begin with a **0**
		; For example, 12354 and 11111, so we need to remove the first element
		; Taking the product yields **0** if any element is **0**
		; However, in order to be a DJMcMego pair, two digits at the same index
		;   cannot be the same, otherwise their digit-wise difference will be **0**
; ============= ;
L,		; Define a lambda function
		;
		; This lambda function takes two arrays of digits as input
		; Returns an integer to determine if those digits represent a DJMcMego pair
		;
		; A lambda function is shorter to define than a normal function
		; However, when called inside functions with the **]** command,
		;   they consume the entire stack as arguments, meaning that using functions
		;   allows us to preserve important values
		;
		; Example arguments:		[[3 1 7 1 6] [4 5 9 4 1]]
		;
		; First check:
		;
	BcB_	; Digit differences;	STACK = [-1 -4 -2 -3 5]
	€|	; Magnitudes;		STACK = [1 4 2 3 5]
	B]dBkbU	; Save a copy, **A**	STACK = [1 4 2 3 5]			**A**: [1 4 2 3 5]
	BSVcGbU	; Overlapping pairs;	STACK = [[1 4] [4 2] [2 3] [3 5]]
	£>	; Sorted descendingly?	STACK = [0 1 0 0]
	sVcG	; How many?		STACK = [1]
	B]V	; Save a copy;		STACK = []				Register: [1]
		;
		; Second check:
		;
	BK	; Retrieve **A**;		STACK = [[1 4 2 3 5]]
	B#	; Sort;			STACK = [[1 2 3 4 5]]
	BK	; Retrieve **A**;		STACK = [[1 2 3 4 5] [1 4 2 3 5]]
	BcB_	; Element differences;	STACK = [0 -2 1 1 0]
	0º>b]	; Any negatives;	STACk = [[1]]
		;
		; Third and fourth checks:
		;
	G	; Retrieve register;	STACK = [[1] [1]]
	BK	; Retreive **A**;		STACK = [[1] [1] [1 4 2 3 5]]
	{w}b]	; Run **w**;		STACK = [[1] [1] [1]]
	++	; Concatenate;		STACK = [[1 1 1]]
	b*1=	; Product = 1;		STACK = [1]
	BK{k}	; Run **k**;		STACK = [1 120]
	*	; Multiply;		STACK = [120]
		; To force output as **1** and **0** values,
		;   append a ? to the end, to output the sign (forces boolean conversion)
```
[Answer]
# [R](https://www.r-project.org/), ~~110 106~~ 84 bytes
```
function(x,y,z=abs(x-y),w=z-min(z)+1)adist(p(1:max(w)),p(w),c("s"=9))==2
p=intToUtf8
```
[Try it online!](https://tio.run/##VY7LbsMgEEX3/grLK1BJleFhoBJ/0a4iL6gbK5ZixzJEif3zLi5@NHcB4uhyZvrJmRIxkJCTlAvNgSRpCFAmOElhTiQil1qRlM6JJFTy1w5IoUOFM7FZuHhpsJDQgOPypnHOP@u8i3zZRWmpglYqla9erudfeaiylTC6TsJJ0pir7brrgJzvXXetPbLuvbzY3pb@3COHSZZhElh7b859XYYvlZmqe1v6@taiJxnIaOy3Q8/DgMnDjIembtGI3wDbn9p51CH4aOwTPTAmXThJiTKXGY2xMTTpTN36z9uXr9RUoeZ0gqIg4aJFgZM/wCLgGxAR5BuQEagN6AjguBFYtLB7YRHDboZFDbsbFjnsdlj0dNfTdetZP/0C "R – Try It Online")
@JayCe with a ridiculous 22 byte save!
The workhorse here is `adist`, which gives a "generalized Levenshtein edit distance" between two strings. By default the distance is the count of the minimal number of insertions, deletions, and substitutions required to transform one string into another. But `adist` allows you to weight things how you like - so I've weighted each substitution to add 9 to the distance rather than 1. This effectively forces the algorithm to look for insertions and deletions only. 
This code accepts vectors of integers, computes the absolute elementwise differences, and translates the result to begin at 1, calling it `w`.
Then the custom weighted Levenshtein distance is computed between `w` pasted together to make a string and the string `"1234..."` (actually utf-8 `"\001\002\003\004...`" but `adist` doesn't care.) with the same number of characters as `w`.
The only way the string can have exactly one digit out of place is if you make one deletion and one insertion, giving a distance of 2.
[Answer]
# JavaScript, ~~137~~ ~~136~~ ~~135~~ ~~134~~ ~~132~~ 123 bytes
Takes input as two arrays of digits in currying syntax, outputs `0` for `true` and any other number for `false`.
```
a=>b=>(c=a.map((x,y)=>(x-=b[y])<0?-x:x)).map(x=>t+=x>c[++j]&(d=[...c].sort()).slice(i=0,-1).every(x=>d[++i]-x&1),t=j=0)|t^1
```
---
## Test Cases
```
f=
a=>b=>(c=a.map((x,y)=>(x-=b[y])<0?-x:x)).map(x=>t+=x>c[++j]&(d=[...c].sort()).slice(i=0,-1).every(x=>d[++i]-x&1),t=j=0)|t^1
o.innerText=`${l=`-`.repeat(21)}\n|   #1  |   #2  | f |${m=`\n|${`|`.padStart(8,`-`).repeat(2)}---|\n`}${[[31716,45941],[12354,11111],[56798,22222],[23564,11111],[1759,2435],[12345,11111],[3333,2101],[22354,22222],[31717,45941],[89789,78865],[14954,61713]].map(([x,y])=>`| ${JSON.stringify(x).padEnd(6)}| ${JSON.stringify(y).padEnd(6)}| ${f([...``+x])([...``+y])} |`).join(m)}\n`+l
```
```
<pre id=o></pre>
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~116~~ ~~119~~ 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!](https://tio.run/##dZDbDoIwEETf/Yp9bOOaWEBETf0R0geMEElaJF4S8Odxu8VLDCYbaDNnptO2/e10bqJhOJYVOFHgQW6tzovDVXSLXlbnC3TYQ93Ao25ZNrv2Ujc3uN6dKPcVeKTE6oVYtLnaGim1VlrbshFWLlzR0W/uar8bnMhjBIWw5m9qME8QVggbBFooI2eEkBIhxCwkhCiGxwkIKSmnkDEjJGLLOAF5R6R/U0IRf3yISILlp4VvOO2PWfcT/KQs32L0c4uJit9vsZ5@i4z3hGShZVhlfKtP0YSp8aD0KzU2cngC "Python 2 – 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!](https://tio.run/##hZDdaoQwEIXv@xRztSQQYU1s1v7YFwleuFTbgGbF3YL25e1kRuyydSkESTzfnJk5/XT5PAU9z@91A52o1FE@t4WrjmcxJpNsTgOMagIf4Nv3JJcvQ@Fa58vEJ50PoiXIR2Sowkct2jr@RK4ffLiI81cnBlkUe7kjyY1ArlQAvgHqJd/SUr5quavChPjcCWcUpAoO9LWlcpmCRwVPCvCC8AMiqGgFhoQMkZTg5TCCiiUXLMwR0VSyHEZWC3vXhQeJ7dki45KbKeKE2/X2f8SQHg@3QGW/ivpm0Y0truM6bMeV0xuRnBfhW06L/@6SEbU0sleuZp2FszJ34@KE7BLSH2T@AQ "Python 2 – 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
[Answer]
# [Haskell](https://www.haskell.org/), ~~182~~ ~~163~~ ~~162~~ 132 bytes
```
(#)=zipWith(-)
a&b|s<-abs<$>a#b=or[all(==1)$tail a#a|(x,h:y)<-p s,(q,r)<-p$x++y,a<-[q++h:r],a/=s]
p l=[splitAt k l|k<-[0..length l]]
```
Takes input as a list of digits. Helper function `p` that gives all possible ways to split a list into two parts is used to take an element out and again to insert it elsewhere. 
[Try it online!](https://tio.run/##XY9NasMwFIT3OcUjcYqEfxrF/8YOdNlFoYtCF44pMnFjEcVxLJUmJeseoEfsRVw5EaXpA6Fh@DR6U1OxqTjv2bbddRKeqoN0HjvWyNfRiq2ZFJAkcN9IsBeQq7vQdralLeoqunLat67Cjqh37z2a4OyDtc9M1sjGI3pTnkRq01KkxoJOymzX5ZRzlGUEG5IyDnRCT@hg1ckRp3YLwkJ7qxukcTDNo0VTO9@bZp10hUVvM1GMWuBZLlrO5J2EDfDTRiEzx@FVs5Y18KLot5Q1w3YPL4CWiFolthftuRGMp2wph/P9@QVTsWzGgGiSqFoYSkBDBzBA96Y3WpQYjyAH5JKQBGCB58ceUZYFiMxd31OCDHOx/CCMIyXmw1wsBQX/KBL6MQyU5/rwm@X515Sr5kyRGdHUXP/4J37YK7zeK4rDKFYijKLA1/FefH4YKNrVWX7gEv2jp6yi/wE "Haskell – Try It Online")
]