You are given an array names consisting of n strings.
Define a group G(i) for 1<=i<=N of strings using the given algorithm.
initialize a queue and add string S(i) in queue,mark index i as visited.
while the size of queue is greater then 0
Group G(i) consists of all strings from array names that have their index as visited.
If there are 2 names with their set of unique alphabets A and B ,difference of atmost 1 can only mean one of the following:
output the group with maximum size and minimum total group required .
Sample Test
INPUT
["HARRY","HARI","LATA","LALA","CHAR"]
OUTPUT
3 2
also how much rating would you give this question?