This is another tricky question for the job seekers. Concept is pretty simple here. You have to write a boolean method which will validate the address and return true if it finds PINCODE and return false it does not find.
I am using regular expression to solve this approach.
Sample input:
61 B, Palm Avenue, Joy Bijoy Apartment, 1st Floor, Flat No 1D, West Bengal
Output:
Pincode does not exist.
Sample Input:
61 B, Palm Avenue, Joy Bijoy Apartment, 1st Floor, Flat No 1D, West Bengal 700112
Output:
Pincode exist.
Sample Input:
61 B, Palm Avenue, Joy Bijoy Apartment, West Bengal 700112, 1st Floor, Flat No 1D
Output:
Pincode Exist.
Implemented code:
Sample Output 1:
Sample Output 2:
Sample Output 3:
I am using regular expression to solve this approach.
Sample input:
61 B, Palm Avenue, Joy Bijoy Apartment, 1st Floor, Flat No 1D, West Bengal
Output:
Pincode does not exist.
Sample Input:
61 B, Palm Avenue, Joy Bijoy Apartment, 1st Floor, Flat No 1D, West Bengal 700112
Output:
Pincode exist.
Sample Input:
61 B, Palm Avenue, Joy Bijoy Apartment, West Bengal 700112, 1st Floor, Flat No 1D
Output:
Pincode Exist.
Implemented code:
Sample Output 1:
Sample Output 2:
Sample Output 3: