DIY: Valid Number
Solve the interview question "Valid Number" in this lesson.
We'll cover the following...
We'll cover the following...
Problem statement
Validate if a given string can be interpreted as a decimal number or not. Here is a list of characters that can appear in a valid decimal number:
-
Numbers -
0-9 -
Exponent -
"e" -
Positive/negative sign -
"+"/"-"...