For a given line, find the 1st repeated word in the line.
Input: "Ravi had been saying that he had been there" Output: had Input: "Ravi had been saying that" Output: No Repetition Input: "he had he" Output: he
We have a solution to this problem, please refer to Output: Latest questions
# Function to find the first repeated word in a line
# first splitting the given line with a space
# into words
. split (
# now convert the word list to a dictionary
# go through the wordlist and check which is the first word
# has a frequency of" 1
# Driver software
" __ main__ "
’Ravi had been saying that he had been there’