This question exist only because of pure curiosity. Not a homework.
Find the fastest way to find two missing number in an array 1..n
So, In a related post: Quickest way to find missing number in an array of numbers I found out that you can do this pretty quickly by summing up and substracting total.
but what about 2 numbers?
So, our options are:
Sequential search
Summing up items, substracting from total for all items from 1..n, then searching all possible cases.
Anything else? Possible to have O(n) solution? I found this in ruby section of one of the websites, but any language is considered (unless there are some specific things for a language)
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)