rewrite leetcode valid number