Hello @Ezeji, thank you for participating in Week 1 of Algorithm Fridays.
This is the most memory-optimal solution because you aren't using any data structure, awesome stuff!
The only one gotcha I see here is that your solution assumes is that the input array cannot have a
That said, your solution got a special mention in this blog post here where I posted our solution. Please read through and let me know what you think.
Thanks once again and see you on Friday!
Thank you really for your efforts and this initiative. It is really a great vision that would have massive impact on the tech ecosystem by providing a learning opportunity for persons like myself who are life-long learners. Well done to you and your team!
I also want to thank you for the special mention on your blog as well as your feedback for improvement through this medium, it means a lot to me.
My question as regards handling null parameter passed to the function for a robust solution is, can such scenario also be taken care of by using a try-catch code construct, in other words, writing a function that performs its intended operation and handle every other out of bound edge cases using exception handling ?