Saturday, January 6, 2018

Find smallest missing nonegative number

January 6, 2018

Introduction


I had a mock interview 12:00 PM. As a programmer I cannot tell the peer is an excellent programmer until the peer wrote one line of code but I could not understand. So I asked the peer what is the meaning to turn the positive number to negative number, and the peer told me that he likes to mark the index is found.

I have practiced this algorithm over 5 times, but I never came cross this idea.

Code review


Here is C++ code for the algorithm.

My last practice in Nov., 2017 is here.

No comments:

Post a Comment