Today let’s go over finding the smallest difference between two numbers in two seperate arrays. In order to solve this problem we must find a pair of numbers whose absolute difference is closest to zero. This function should return an array containing these two numbers. It is assumed that there will only be one pair of numbers with the smallest difference. Let’s get to solving…

We begin by sorting both of the input arrays in place and then we need to create some variables to store and update information as we go along. We create index variables for both arrays…

Connor Mulholland

Software Engineering Student at Flatiron School

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store