Missing Number Performance Tests 202/01/2020
A couple of weeks ago, I had a post about a tipical interview question: finding a missing number from an unordered array.
The task goes as follows:
Given an array with integers from 1 to N. The order of the integers is unknown. One of the randomly chosen number is replaced with 0. Create a method that receives the array as an input and returns the replaced number.
I am not going into the details of edge cases, input validation, error handling, etc. This post purely checks the performance aspects of some of the possible solutions. I also assume that N=x*8.