Alphabetic Game

2.8

20 votes
Problem

Riya, Rajiv & Rohit are playing a game in which at once two of them write a single alphabetic letter on a piece of paper & the third person is supposed to write all the letter between this two letters in in proper alphabetic order except the vowels(a,e,i,o,u).

Suppose Riya & Rajiv write - A & J. Then Rohit should write- B,C,D,F,G,H. the number should be separated by a comma(,) sign.

NOTE- if the two people write the same letter then the output should be "NA". Ex- if Riya and Rajiv both write A then output should be NA.

Also if Rajiv write A & Riya Write J, the output should be the alphabets between A & J, not between J & A.

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?