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:

  1. A two-letter prefix common across the state.
  2. A two-digit district identifier, potentially with leading zeros.
  3. A series of two letters selected from specified ranges.
  4. 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 and ALPHA3 <= ALPHA4

Note that the task requires computing the result only and does not require printing, it is handled separately.

AnswerBot
4mo

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

Help your peers!
Select
Add answer anonymously...

TCS Software Developer interview questions & answers

A Software Developer was asked 4w agoQ. What is the process flow for converting an infix expression to a postfix express...read more
A Software Developer was asked 4w agoQ. What is the process for synthesizing data to train a machine learning model with...read more
A Software Developer was asked 1mo agoQ. Write code to reverse a string.

Popular interview questions of Software Developer

A Software Developer was asked 1w agoQ1. What is Python?
A Software Developer was asked 3w agoQ2. What is the process for synthesizing data to train a machine learning model with...read more
A Software Developer was asked 1mo agoQ3. What is a string?

Top HR questions asked in TCS Software Developer

A Software Developer was asked 5d agoQ1. Can you provide an explanation of your project?
A Software Developer was asked 2mo agoQ2. Why should we choose you?
A Software Developer was asked 2mo agoQ3. What are your hobbies?
TCS Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits