Try Parse JSON Else Number Else String

JavaScript Medium 3 views
Back to Questions

Problem Description

One line text is given. First try JSON.parse. If it fails, try Number() and if finite print NUMBER . Else print STRING .

Input Format

One line text.

Output Format

One line output.

Sample Test Case

Input:
42
Output:
NUMBER 42

Constraints

Input length up to 2e5.

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next