Medium
Where Was It First Seen?
Read words. Find the first word that appears for a second time and print it with the position (from 0) of its first appearance, using a dictionary of first positions. Print
none if no word repeats.Input
Words separated by spaces.
Output
One line.
Sample 1
Input
a b c b a
Output
b 1
Sample 2
Input
x y z
Output
none
Output appears here