b [ j ] - a [ i ] = b [ idx . second ] - a [ idx . first ] b [ j ] - b [ idx . second ] = a [ i ] = a [ idx . first ] So sub - arrays are a [ idx . first + 1. . . i ] and b [ idx . second + 1. . . j ]
if swap : NEW_LINE INDENT idx = index [ b [ j ] - a [ i ] ] NEW_LINE printAns ( idx [ 1 ] + 1 , j , 1 ) NEW_LINE printAns ( idx [ 0 ] + 1 , i , 2 ) NEW_LINE DEDENT else : NEW_LINE INDENT idx = index [ b [ j ] - a [ i ] ] NEW_LINE printAns ( idx [ 0 ] + 1 , i , 1 ) NEW_LINE printAns ( idx [ 1 ] + 1 , j , 2 ) NEW_LINE DEDENT return NEW_LINE