Automated grading of homework assignments and tests
- fork this repository
- solve the task
- commit with proper message
A variable of type str is given. Find how many numbers it contains and return.
Example 1:
Input: s = "python 2022"
Output: 4
Example 2:
Input: s = "e324xE"
Output: 3
Constraints:
- 1 <= length(s) <= 10^5
A variable of type str is given. Find how many letters it contains and return.
Example 1:
Input: s = "Python 2022"
Output: 6
Example 2:
Input: s = "e324xE"
Output: 3
Constraints:
- 1 <= length(s) <= 10^5
A variable of type str is given. Find how many punctuations it contains and return.
Example 1:
Input: s = "#hashtag@$"
Output: 3
Constraints:
- 1 <= length(s) <= 10^5
A variable of type str is given. Find how many uppercase letters there are and return.
Example 1:
Input: s = "CodeschoolUz"
Output: 2
Constraints:
- 1 <= length(s) <= 10^5
A variable of type str is given. Find how many lowercase letters there are and return.
Example 1:
Input: s = "CodeschoolUz"
Output: 10
Constraints:
- 1 <= length(s) <= 10^5
A variable of type str is given. Find and return how many consonant letters there are.
Example 1:
Input: s = "CodeschoolUz"
Output: 7
Constraints:
- 1 <= length(s) <= 10^5
A string of numbers is given. Find how many even numbers there are and return.
Example 1:
Input: s = "56786543250"
Output: 6
Example 2:
Input: s = "123456"
Output: 3
Constraints:
- 1 <= length(s) <= 10^5
A string of numbers is given. Find how many odd numbers there are and return.
Example 1:
Input: s = "1567534"
Output: 5
Example 2:
Input: s = "3489769"
Output: 4
Constraints:
- 1 <= length(s) <= 10^5
A string of numbers is given. Find the sum of all the numbers and return.
Example 1:
Input: s = "987654"
Output: 39
Example 2:
Input: s = "12"
Output: 3
Constraints:
- 1 <= length(s) <= 10^5
A string of numbers is given. Find and return the sum of all odd numbers.
Example 1:
Input: s = "589765"
Output: 26
Example 2:
Input: s = "98421"
Output: 10
Constraints:
- 1 <= length(s) <= 10^5
- don't copy other solutions or any solution
- don't remove comments