Using an Array as a built in index for LeetCode problems

An example array with index places shown

Before We Start

Why?

O(n) solutions are often required in Interviews, and for some LeetCode problems. Rather than using extra space, we can use the property of arrays that they are ordered and have an intrinsic index in order to (often) find a missing Integer in an…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store