Parse Integer or INVALID

JavaScript Easy 4 views
Back to Questions

Problem Description

One token is given. If it is a valid base-10 integer (like -12, 0, 99) print its double. Else print INVALID. Use try/catch for validation.

Input Format

One token string.

Output Format

One line output.

Sample Test Case

Input:
12
Output:
24

Constraints

Token length up to 1e5.

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next