Leetcode Plus One Solution Javascript Snake Code Python