Smallest Missing Positive Integer Leetcode Problems Javascript