Input Validation
You are given an input that may or may not represent a valid integer N.
Determine whether the given input is a valid integer within the range -100 to 100.
- If the input is a valid integer, print Valid.
- Otherwise, print Invalid.
Input
- The input contains a single value N.
- The input may be an integer or a string containing lowercase English letters, spaces, or symbols.
Output
- Print Valid if the input is a valid integer between -100 and 100, inclusive.
- Otherwise, print Invalid.
Example 1:
Input:
15
Output:
Valid
Example 2:
Input:
hello
Output:
Invalid
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- Input may be any string or integer.
- Integer range: −100 to 100.
- string may contain lowercase english letters, symbols.