
Maximum Vehicle Registrations Problem
Bob, the mayor of a state, seeks to determine the maximum number of vehicles that can be uniquely registered. Each vehicle's registration number is structured as follows: ST 01 AB 1234
. The registration number comprises four sections, with specific rules governing each part.
Explanation:
The registration is formed by:
- A two-letter prefix common across the state.
- A two-digit district identifier, potentially with leading zeros.
- A series of two letters selected from specified ranges.
- A sequence of four digits, fixed at four digits even if leading zeros are present.
Your task is to determine the maximum possible number of unique vehicle registrations given the number of districts, the range of series letters, and the range of digits.
Input:
The first line contains integer 'T', the number of test cases.
For each test case:
- The first line has 'districtCount', the number of districts.
- The second line has four space-separated characters representing the letter ranges for series: 'ALPHA1', 'ALPHA2', 'ALPHA3', 'ALPHA4'.
- The third line contains four space-separated integers denoting the digit ranges: 'DIG1', 'DIG2', 'DIG3', 'DIG4'.
Output:
For each test case, output a single integer indicating the maximum number of unique vehicles that can be registered.
Example:
Input:
2
5
A D K N
2 3 4 5
3
P T L R
6 7 8 9
Output:
80000
120000
Constraints:
1 <= T <= 10^4
1 <= Number of districts < 10^2
A <= Range of alphabets <= Z
0 <= Range of digits <= 9
ALPHA1 <= ALPHA2
andALPHA3 <= ALPHA4
Note that the task requires computing the result only and does not require printing, it is handled separately.


Calculate the maximum number of unique vehicle registrations based on given constraints.
Parse input for number of test cases, district count, letter ranges, and digit ranges.
Calculate the total number...read more

Top TCS Software Developer interview questions & answers
Popular interview questions of Software Developer
Reviews
Interviews
Salaries
Users/Month