Find the repeated word | Wipro previous year question paper solution
Problem of Find the repeated word | Wipro previous year question paper solution :-
‘Word Finder’ is an online game in which the player needs to enter text. The game auto detects the word occurring more than once in the player’s text .At the end of the game the repeated words are display to the player’s screen.
Write an algorithm to find the words occurring more than once in the player’s text.
input:- the input consists of a string playerText, representing the text entered by the player.
Output:- Print space separated strings in the lexicographical sorted order representing the repeated words in the player’s text . if no word is repeated print “NA”.
Note:- A Word is an alphabetic sequence of characters with no whitespaces, and there is no punctuations in the input text.
playerText is a case sensitive (i.e cat and CAT are the different word). It consist the lower case and the upper case letter from the English alphabet.
Example of Find the repeated word | Wipro previous year question paper solution:-
# takign input of the sentence mystring=input() # spliting the sentence into words words=mystring.split() dic={} # counting the frequency of the words for i in words: if i not in dic: dic[i]=0 dic[i]+=1 # if the frequency of the words is more than one then # print it for i in dic: if dic[i]>1: print(i,end=" ")
batman latt mouse
Recommended Post:
-
codechef problems:-
- Primary test
- Sum or difference
- point and line
Wipro :-
- Update the booking ID | Wipro previous year question paper solution
- Pages in PDF
- Find the location id
- Find the odd digits
- Find the Product ID
Infytq :-
Key Points;-
Hackerrank:-
- Python : missing characters : hackerrank solution
- Python : string transformation | Hackerrank solution
- Active Traders certification test problem | Hackerrank Solution
- Usernames changes certification test problem | Hackerrank Solution
- string Representation of objects certification test hackerrank solution
- Average Function | hackerrank certification problem solution
C-tutorial:-
- Micros in C
- Pointer in c
- Function declaration
- Types of user define function
- return type of function
- 2D array
See more:-
- c program to convert specified days into years weeks and days
- Print Reverse Hollow Pyramid
- Update the booking ID | Wipro previous year question paper
- Pages in PDF | Wipro previous year question paper
- Sparse Matrix in data structure
- Find the location ID | Wipro previous year Coding question
- find the odd digits | Wipro Coding question
- Find the product id | Wipro Coding question
- Difference between static and dynamic memory allocation
- What is asymptotic Notation