Returns minimum difference between any two terms of shifted tables of ' a ' and ' b ' . ' x ' is shift in table of ' a ' and ' y ' is shift in table of ' b ' .
function findMinDiff ( $ a , $ b , $ x , $ y ) {