Smallest Difference


Collapse Content

Sorting is often useful as the first step in many different tasks. The most common task may to be make things easier to find later, but there are other uses also.

Challenge
Given a list of unsorted numbers, can you find the pair of numbers that have the smallest difference between them?

Output
Output the pair of numbers with the smallest difference. Print the smaller number before the larger number.

Challenge

Output the pair of numbers with the smallest difference.

Please sign in or sign up to submit answers.

Alternatively, you can try out Learneroo before signing up.

Contact Us
Sign in or email us at [email protected]