Back
Close

Occurrence of Characters in a String

Statement

 Goal

You must find the percentage (rounded up) that given characters make up in a given string (without taking into account the case).
Input
Line 1 : A string s
Line 2 : An integer n for the number of given characters
n next lines : A character c
Output
n lines : The percentage (rounded up) that the given character c makes up of the string s
Constraints
n ≥ 1
c lower case alphabetic character
Example
Input
Bonjour
1
j
Output
15%

Game modes
Fastest, Shortest

Test cases
Test 1 Test
Input
Bonjour 1 j
Output
15%

Validator 1 Validator
Input
Hello 1 l
Output
40%

Test 2 Test
Input
How to resolve this problem? 2 s v
Output
8% 4%

Validator 2 Validator
Input
Comment resoudre ce probleme ? 3 s r m
Output
4% 10% 10%

Test 3 Test
Input
The answer is pretty easy 3 t h k
Output
12% 4% 0%

Validator 3 Validator
Input
La reponse est tres facile 3 l p z
Output
8% 4% 0%

Test 4 Test
Input
The answer is pretty easy 3 t h k
Output
9% 3% 0%

Validator 4 Validator
Input
La reponse est tres facile 3 l p z
Output
6% 3% 0%

Test 5 Test
Input
VoUs AlLeZ rEuSSiR 5 v s e k n
Output
6% 17% 12% 0% 0%

Validator 5 Validator
Input
YOu WilL SucCeEd 5 y l c m b
Output
7% 13% 13% 0% 0%

Test 6 Test
Input
VoUs AlLeZ rEuSSiR !!!!!!! 5 v s e k n
Output
4% 12% 8% 0% 0%

Validator 6 Validator
Input
YOu WilL SucCeEd!!!!!!! 5 y l c m b
Output
5% 9% 9% 0% 0%

Test 7 Test
Input
R 1 r
Output
100%

Validator 7 Validator
Input
K 1 k
Output
100%

Test 8 Test
Input
2 a b
Output
0% 0%

Validator 8 Validator
Input
2 r t
Output
0% 0%

Solution language

Solution

Stub generator input