REVENG04 - Editorial

PROBLEM LINK:

Practice
Contest

Author: Akshat Jain
Tester: Ankit Kathuria
Editorialist: Akshat Jain

DIFFICULTY:

MEDIUM

PREREQUISITES:

Interest in Coding, Strings.

PROBLEM:

Finding the problem is the first task based on the input, output format and exe file provided. Then think the logic and code the same.

QUICK EXPLANATION:

The task in this problem is to find the alphabets which are present only in one word among the input paragraph string.

EXPLANATION:

• The first input is the number of test cases.

• The next line contain a string paragraph i.e. space separated small case letters.

• We may use a matrix with 10000 rows and 26 column, each row representing a word from string and columns representing the alphabets present in each word.

• Now we may count the occurrence of each alphabet in different words(repetitions in same word are ignored), this may be done by simply adding up all the rows(columnwise).

• If the addition comes out to be exactly one then it has to be displayed, else not.

• Finally all the alphabets must be displayed in alphabetical order and NONE if no such alphabet is found.

AUTHOR’S AND TESTER’S SOLUTIONS:

Author’s solution can be found here.
Tester’s solution can be found here.