We have introduced the encoding and decoding.
In this problem, you need to process the numerical format of the TW ID number and return the register location of the person.
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:
M to numerical form as 21. (We will provide the mapping table below)M140051653) as a numerical form (21140051653).10 should be 0. isdigit() to verify if the input character is digit or not The first several lines are the required mapping table for the alphabet and its number, such as:
K,19,MiaoliCountry
M,21,NantouCounty
N,22,ChanghuaCounty
O,35,HsinchuCity
The last line is the ID number that is missing the alphabet which is shown as:
140051653
Note that the candidate will not be the same for different test cases.
You need to provide the possible registering city/county for the id number.
To find the possible registering city/county, you need to go over all the possible candidates to verify them.