Skip to content

Instantly share code, notes, and snippets.

@ottomata
Created July 31, 2019 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ottomata/9fa75a50b1f7d5e2115316f877ec3c4f to your computer and use it in GitHub Desktop.
Save ottomata/9fa75a50b1f7d5e2115316f877ec3c4f to your computer and use it in GitHub Desktop.
You are given a very very large list of unsorted integers. These
integers are supposed to be unique and, if sorted, contiguous. However, you
suspect that this is not the case, so you want to write code to check for
missing or duplicate integers. Write code to return these results:
- Are there any missing or duplicate integers?
- How many missing integers?
- How many duplicate integers?
- Which integers are missing?
- Which integers are duplicates, and how many duplicates of each
integer?
You may write separate code or functions to answer each of these
questions;
i.e. it's ok to pass over the data more than once to answer all
questions.
Your implementation may be in any language/system. However,
remember that this is big data, so the solution needs to useable at that scale.
Please spend no more than 3 hours. If you'd like to spend more, it's up
to you - just make a note of when you get to three and report back
as to when you restarted the clock .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment