Here is the interview question prompt, presented for reference.
You are working as a software engineer at a company that develops a financial trading platform. Your team is working on a new feature that allows users to enter numeric strings into a text field and have them parsed and converted into numbers.
One of the requirements for this feature is that the numeric strings must be valid. A valid numeric string must consist of:
+
or -
)..
followed by one or more digits.e
or E
followed by an integer.For example, all the following are valid numeric strings:
"+"
"-"
"123"
"-123.456"
"1e10"
"-90E3"
while the following are not valid numeric strings:
"abc"
"1a"
"1e"
"e3"
"99e2.5"
You need to write a function that can be used to determine if a given string is a valid numeric string.
You can see the full challenge with visuals at this link.
Challenges • Asked over 1 year ago by Jake from AlgoDaily
This is the main discussion thread generated for Valid Numeric String (Main Thread).