Problem:-
It's a holiday season for all school students around the world! Unfortunately, Mahamba is busy preparing for International Olympiad in Informatics, which will be held in Tehran, Iran. He is now facing a new challenge from his teacher Aceka, and it goes something like this:
You have a string x of length N, which consists of small English letters. You have to find the number of indexes a, b, c and d, such that and , as well as .
He is baffled and definitely needs some help. So, you, the best programmer in Lalalandia, decided to give him a hand!
Input format
The first line contains the number N - the length of a string x. The second line contains the string x itself.
Output format
The first and only line should contain the answer to the problem.
Constraints
The string x only contains small English letters.
There are only 2 variants: (a=1,b=2,c=3,d=4) and (a=2,b=3,c=4,d=5)
Code:-
Solution 1 ( C language):-
Solution 2 ( C++ language):-
Solution 3 (java language):-
keywords:-
Recommended Post:-
- codechef problems:-
Wipro :-
- Update the booking ID | Wipro previous year question paper solution
- Pages in PDF
- Find the location id
- Find the odd digits
- Find the Product ID
Infytq :-
Key Points;-
Hackerrank:-
- Python : missing characters : hackerrank solution
- Python : string transformation | Hackerrank solution
- Active Traders certification test problem | Hackerrank Solution
- Usernames changes certification test problem | Hackerrank Solution
- string Representation of objects certification test hackerrank solution
- Average Function | hackerrank certification problem solution
C-tutorial:-
- Micros in C
- Pointer in c
- Function declaration
- Types of user define function
- return type of function
- 2D array
- c program to convert specified days into years weeks and days
- Print Reverse Hollow Pyramid
- Update the booking ID | Wipro previous year question paper
- Pages in PDF | Wipro previous year question paper
- Sparse Matrix in data structure
- Find the location ID | Wipro previous year Coding question
- find the odd digits | Wipro Coding question
- Find the product id | Wipro Coding question
- Difference between static and dynamic memory allocation
- What is asymptotic Notation
0 Comments