rewrite leetcode plus one