Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com

Help Bob Out!

Easy
0/40
profile
Contributed by
6 upvotes
Asked in companies
InfosysBottomline Technologies

Problem statement

Bob has just turned 18 years old and has opened a Bank account. However, since he has just opened his bank account he is not very experienced about the working of banks, therefore he asks for your help. Bob wants to know whether the IFSC Code given by the bank is valid or not, can you help him?

A valid IFSC (Indian Financial System) Code must be of the following format:-

1) The string should be 11 characters long.

2) The first four characters of the IFSC Code should be upper case alphabets.

3) The fifth character should be 0.

4) The last six characters should be alphanumeric.

Detailed explanation ( Input/output format, Notes, Images )
Constraints:
1 <= T <= 10
1 <= |S| <= 100

Time Limit: 1 sec
Sample Input 1:
2
SBIN0125620
AAAA012562*
Sample Output 1:
True
False
Explanation For Sample Output 1:
The given string S satisfies all the 4 above-mentioned conditions, so True is returned.
In the given string S the last character is not an alphanumeric character, so False is returned.
Sample Input 2:
2
SBIN1125620
SBI00
Sample Output 2:
False
False
Explanation For Sample Output 2:
The given string S does not contain 0 in the fifth position, so False is returned.
In the given string S the is not of length 11, so False is returned.
Full screen
Console