Valid Number

Exercise from LeetCode, it is accepted