We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I found using an object in JS was quite a straightforward approach IMO.
EDIT: To elaborate, my reason for choosing to use an object for this solution is because I found it to be a reasonable choice to store the numbers as keys and then add 1 for each occurance for the fully intact array and subtract 1 for each occurance of the array that was incomplete. Thereafter, if any of the resulting values of the object keys are greater than 0, they are considered as missing. Cheers
Missing Numbers
You are viewing a single comment's thread. Return to all comments →
I found using an object in JS was quite a straightforward approach IMO.
EDIT: To elaborate, my reason for choosing to use an object for this solution is because I found it to be a reasonable choice to store the numbers as keys and then add 1 for each occurance for the fully intact array and subtract 1 for each occurance of the array that was incomplete. Thereafter, if any of the resulting values of the object keys are greater than 0, they are considered as missing. Cheers
Here's my solution: