valid number an DFN problem
functional programming in scala day1