Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2. * Challenge Number 1!
  3. *
  4. * getSyncLogSource returns an object with a one method: pop() which will return a LogEntry.
  5. *
  6. * A LogEntry is simply an object of the form:
  7. * {
  8. *      date: Date,
  9. *      msg: String,
  10. * }
  11. *
  12. * All LogEntries from a given log source are guaranteed to be popped in chronological order.
  13. * Eventually a log source will end and return boolean false.
  14. *
  15. * Your job is simple: print the sorted merge of all LogEntries across `n` log sources.
  16. *
  17. * Call `printer.print(logEntry)` to print each entry of the merged output as they are ready.
  18. * This function will ensure that what you print is in fact in chronological order.
  19. * Call 'printer.done()' at the end to get a few stats on your solution!
  20. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement