Check if a given string is a valid number (Integer or Floating Point)

0

0 votes
Easy-Medium
Problem

Check Given String is a valid Numbers(Integer or Floating Point) Or Not. (Floating point can be +ve or -ve. With e present or not present.)

INPUT: first Line Test Case T. Second Line String.

Output: if String is a Valid Number Output Should be 1 Otherwise 0.

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

input 10e5.4 is neither a valid Integer nor Floating Point value .so Output is 0. input 2e10 is a valid Floating Value. So output is 1.

Editor Image

?