Plus One Problem In Leetcode Javascript