← All problemsSign in

Valid Number

Validate if a given string can be interpreted as a decimal number. Return 1 for True and 0 for False. Some examples: Input (String) Output (Integer) "0" 1 " 0.1 " 1 "abc" 0 "1 a" 0 "2e10" 1 " -90e3   " 1 " 1e" 0 "e3" 0 " 6e-1" 1 " 99e2.5 "0 "53.5e93"1 " --6 "0 "-+3"0 "95a54e53"0 Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up f

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start