Skip to content

Instantly share code, notes, and snippets.

@ohbadiah
Created May 12, 2020 15:57
Show Gist options
  • Save ohbadiah/8019503cf1fca9969dd483b704207849 to your computer and use it in GitHub Desktop.
Save ohbadiah/8019503cf1fca9969dd483b704207849 to your computer and use it in GitHub Desktop.
Algorithm practice #2
You are given an array of integers.
Can you find the maximum difference between any two integers in the array,
with the restriction that the larger integer follows the smaller one?
For example:
[7 8 9 4 3 1 2] => 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment