in the image in any one these languages - Java 11 or C++ 14 or JavaScript 12 or Python 3.7 or PHP 7.3 or C 9.1.0 or Kotlin

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Please code the question attached in the image in any one these languages - Java 11 or C++ 14 or JavaScript 12 or Python 3.7 or PHP 7.3 or C 9.1.0 or Kotlin 1.4.10 ( any one)
Problem Statement:
Raju is aiming to get good score in National Memory Test and he is surfing through internet to find out
different ways of memorizing the words. He found that jotting down words and recollection is the best
way to remember. You have to help Raju in creating an application which will store words and help him
in remembering the words better.
The word application has to perform two operations:
1) add word: where a word is a string which denoting the National Memory Test word.This add
operation must store word as a new Test word in the application.
2)find partialWord, a string denoting a partial word to search the application. It must count the number
of Test words starting with partialWord and print the count on a new line.
Given P sequential add and find operations, perform each operation in order.
Input Format:
The first line contains a single integer, P, denoting the number of operations to perform.
Each line m of the P subsequent lines contains an operation in one of the two forms defined above.
Constraints:
1 <= P <= 9*10^4
1< word <22
1<partialWord <22
Word and PartialWords contains small letters only
add operation doesn't add any duplicate words.
Transcribed Image Text:Problem Statement: Raju is aiming to get good score in National Memory Test and he is surfing through internet to find out different ways of memorizing the words. He found that jotting down words and recollection is the best way to remember. You have to help Raju in creating an application which will store words and help him in remembering the words better. The word application has to perform two operations: 1) add word: where a word is a string which denoting the National Memory Test word.This add operation must store word as a new Test word in the application. 2)find partialWord, a string denoting a partial word to search the application. It must count the number of Test words starting with partialWord and print the count on a new line. Given P sequential add and find operations, perform each operation in order. Input Format: The first line contains a single integer, P, denoting the number of operations to perform. Each line m of the P subsequent lines contains an operation in one of the two forms defined above. Constraints: 1 <= P <= 9*10^4 1< word <22 1<partialWord <22 Word and PartialWords contains small letters only add operation doesn't add any duplicate words.
add operation doesn't add any duplicate words.
Output Format:
For each find partial operation, print the number of Test words starting with PartialWord on a new line.
Sample Input:
5
add demure
find d
add diligent
add enmity
find enm
Sample Output:
1
1
Explanation:
add demure: This operation will add "demure" as a new word
find d: This operation will print the count of word starting with d and the count is 1 here.
add diligent: This operation will add "diligent" as a new word
add enmity: This operation will add "enmity" as a new word
find enm: This operation will print the count of word starting with enm and the count is 1 here.
Transcribed Image Text:add operation doesn't add any duplicate words. Output Format: For each find partial operation, print the number of Test words starting with PartialWord on a new line. Sample Input: 5 add demure find d add diligent add enmity find enm Sample Output: 1 1 Explanation: add demure: This operation will add "demure" as a new word find d: This operation will print the count of word starting with d and the count is 1 here. add diligent: This operation will add "diligent" as a new word add enmity: This operation will add "enmity" as a new word find enm: This operation will print the count of word starting with enm and the count is 1 here.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY