Help Bob Out! - Validating IFSC Code

Bob has just turned 18 and opened a bank account. Being inexperienced with banking, Bob needs your help to validate whether an IFSC code provided by his bank is valid.

The validity of a given IFSC (Indian Financial System) Code is determined by the following rules:

  1. The code should be exactly 11 characters long.
  2. The first four characters must be uppercase alphabets.
  3. The fifth character should be '0'.
  4. The last six characters must be alphanumeric.

Input:

The first line contains an integer 'T', representing the number of test cases or queries to be evaluated. 
Each of the following 'T' lines contains a string 'S', representing the IFSC Code to be validated.

Output:

For each test case, output 'True' if the IFSC code is valid, otherwise output 'False'. 
Each result should be printed on a new line.

Example:

Input:
2 
ABCD0123456
ABCD123456
Output:
True 
False

Constraints:

  • 1 <= T <= 10
  • 1 <= |S| <= 100
Note:
Focus only on implementing the function. Printing is already managed.
AnswerBot
9d

Validate IFSC code based on given rules and return True or False for each test case.

  • Check if the code is 11 characters long.

  • Verify the first four characters are uppercase alphabets.

  • Ensure the fifth ch...read more

Help your peers!
Add answer anonymously...
Bottomline Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

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

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter