MetaOA #13
Compute Difference Between Uppercase and Lowercase Letters
Estimated EasyJudge-ready
Topics (AI-labelled)Strings
Compute the number of uppercase English letters in the text minus the number of lowercase English letters. Digits, spaces, and punctuation are ignored. The result for an empty string is 0.
Input
One line of 0..100 printable ASCII characters (spaces allowed); the whole line is kept, and leading and trailing spaces are not trimmed.
Output
Output the answer as described; separate multiple results with spaces in order, and output an empty line for an empty array.
Example 1
Input:
CodeSignal
Output:
-6
Example 2
Input:
a
Output:
-1
Example 3
Input:
Output:
0
Example notes
Example 1: CodeSignal has 2 uppercase letters, C and S, and 8 lowercase letters, so the output is 2−8=−6.
Editorial
Loading solution…