#C10845. Valid String Checker
Valid String Checker
Valid String Checker
You are given a string S. Your task is to check if the string is valid. A string is considered valid if it satisfies all of the following criteria:
- It contains at least one uppercase letter (A-Z).
- It contains at least one lowercase letter (a-z).
- It contains at least one digit (0-9).
- It contains at least one special character from the set: \( \{!@#$%^&*()-+\} \).
More formally, let \( S \) be the input string. The string is valid if and only if:
\[ \text{valid}(S) = \Big(\exists c \in S,\ c \in [A-Z]\Big) \land \Big(\exists c \in S,\ c \in [a-z]\Big) \land \Big(\exists c \in S,\ c \in [0-9]\Big) \land \Big(\exists c \in S,\ c \in \{!@#$%^&*()-+\}\Big). \]If all conditions are met, print True
; otherwise, print False
.
inputFormat
The input consists of a single line containing the string S that needs to be validated.
Note: The string may include spaces and special characters.
outputFormat
Output a single line: True
if the string is valid according to the given criteria, or False
otherwise.
HelloWorld1!
True