A digit or a letter
Practice
3 (10 votes)
String
Implementation
Recruit
Basic programming
Algorithms
Easy
String algorithms
Approved
Hashing algorithm
Hashing algorithm
Problem
89% Success 944 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code
You are given a string \(S\) of \(N\) characters \(a_i\). Determine the number of digits and the number of English letters in \(S\).
Input format
First line: String \(S\) of length \(N\)
Output format
- First line: Print the number of digits in \(S\)
- Second line: Print the number of English letters in \(S\)
Constraints
\(1 \le N \le 10\)
All \(a_i\) characters are the standard ASCII characters.
Sample Input
aZ$6
Sample Output
1 2
Explanation
There is only one digit in the given string, that is 1.
Two English letters are: a, Z.
Code Editor
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Submissions
Please login to view your submissions
Similar Problems
Points:20
Tags:
mediumEasy
Points:20
1 votes
Tags:
Easy
3.Unique
Points:20
7 votes
Tags:
String AlgorithmsHashing AlgorithmAlgorithms
Editorial
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor