for each item of ' list1' check if it is in ' list2' but with a different price
for ( var i = 0 ; i < m ; i ++ ) for ( var j = 0 ; j < n ; j ++ ) if ( list1 [ i ] [ 0 ] === list2 [ j ] [ 0 ] && ( list1 [ i ] [ 1 ] != list2 [ j ] [ 1 ] ) ) count ++ ;