Introduction
It is part of my training idea, practice until you cannot get it wrong. I had a mock interview this morning at 10:00 AM. I did write down the idea to do in place swap to find the first missing number. And then I wrote code with a few bugs, I failed a few test cases, and then I fixed the bugs on line 15 and also line 16.
Practice until you cannot get it wrong
Line 18 swap function should be called only after the index is in the array's range.
Here is C# code.
The mistakes I made in my first writing just reminds me that I have to train myself hard than before.
No comments:
Post a Comment