GCTNM Editorial

PROBLEM LINK: Contest Practice

Author: Baban Gain
Editorialist: Baban Gain

DIFFICULTY:

EASY

PREREQUISITES:

String

PROBLEM:

As the name of our college “Government College of Engineering & Textile Technology Berhampore” is too long, many students usually misspell the name.
Hence our college has decided to reject any application, if more than 50% characters of any word is wrong.
You need to calculate if a application will be accepted or rejected.
Note : It is guaranteed that each word in input consists of equal no. of characters as college name. Also, They are not case sensitive.

EXPLANATION:

For every word, count the no. of correct characters and no. of wrong charcters in a word.
As the words are space separated, by space, check if wrong > correct at the end of every word (i.e. on encountering " ") and check the same at the end of string for the last word.

AUTHOR’S AND TESTER’S SOLUTIONS:

Author’s solution can be found here.