| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 12829 | GEC1506 - Basic - WF_Python |
|
| 12832 | GEC1506-TW ID number Verification |
|
Description
Given a few lines of text, you need to parse it and perform the following requirements.
Input
In this assignment, a few lines of text will be given as an input.
Output
You will need to read the given input and calculate the word frequency in the input text.
Then, print out only the bottom 3 as your output results.
For example,
Example
If we get two lines of Input:
'Hello Hello John'
'Hello Bob'
WF value:
'John' is equal to 1
'Bob' is also equal to 1
'Hello' is equal to 3
Output:
John
Bob
Hello
Print the bottom 3 as your OUTPUT.
(If values are the same, the order should depend on their appearance order)
Sample Input Download
Sample Output Download
Tags
Discuss
Description
In this problem, you need to process the numerical format of the TW ID number to see whether the ID number is true or not.
Assuming that there is an ID number as M140051653, the alphabet in the ID number is the registered city/county and the rest numbers are used to verify the ID number.
To make sure the ID number is a verified ID, we need to follow the rules:
- Convert the alphabet
Mto numerical form as21. (We will provide the mapping table in the Input) - Present all the digits of the ID number (
M140051653) as a numerical form (21140051653). - For each digit, we multiply with a given number as:
- Sum all the multiplied result.
- As a qualified ID number, the remainder of the sum result divided by
10should be0.
Input
The 1st line to the 4th line is the required mapping table for alphabet and its number, such as:
K,19
M,21
N,22
O,35
The 5th line is the ID number to be verified, such as:
M140051653
Note that the candidate will not be the same for different test cases.
Output
The result after the verification process, print "True" if the ID number is qualified, otherwise, print "Fake"