How to find 4 byte number that was absent in input?
<p>I have such task, and actually have no idea how to start.
On the input I have a huge array of 4-byte positive numbers. Numbers can be repeated. I know that one of the number is not included in the input array. How can I find this number, using minimum resources?</p>

<p>I am not really sure whether I understand your question fully. However, from what I understand, you have an array of integers and an input (which is also integers).</p>

<pre><code>set_of_integers = set(array_of_integers)

for input_item in input:
    if input_item not in set_of_integers:
        print(input_item)
</code></pre>

<p>In this approach, the input is not sorted, which has O(n log n) time complexity, and also, you don't store the entire input (assuming the input is coming from an external file). The only memory requirement is to hold the set of integers. If there are many redundancies in the original list of numbers, the size of the set will be significantly smaller. A set look up is O(1). Therefore, the provided solution has O(n) time complexity, where n is the number of input items.   </p>

python algorithm