Algorithm · LinkedIn · Easy
Implement a function isNumber(s: str) -> bool that decides whether a given string represents a valid decimal number under the following rules: An optional minus sign - may appear at the very beginning of the string. After any leading sign, the string must contain at least one digit from 0 to 9. At most one decimal point . is allowed. If the string contains a decimal point, there must be at least one digit immediately before it and at least one digit immediately after it.…
Checking your access…