Monday 24 October 2016

String manipulation

Problem Defination:
kriyapad is word present in sentence which shows
actions performed.
Darshil bein fan of kriyapad has prepared list of
kriyapad.
now Anand, Teacher of Darshil gave
assignment to Darshil find maximum number of
kriyapad can be prepared by rearranging given
sentence at a time.

INPUT:

input contain several lines which are kriyapad.
at the end input symbol in new line is shown
by '.' sign.
then there is one line which is number n-
number of sentence given by Anand to Darshil.
then n lines each line contain one sentence.

output:

output contain n lines, each line shows maximum
kriyapad can be formed by rearranging given
sentence

sample Input:
play
give
take
write
speak
listen
.
3
kavan is eating kakdi
Darshil is playing mini-militiae
layte canven wrispeak pgite lis

output:
1
2
6

No comments:

Post a Comment