Loading...
Loading...
Loading...
A support team has a line of words taken from customer messages. Count how many times one chosen word appears.
Words are compared exactly, so Refund and refund are different.
Example
Input
refund late refund refund late refund
Output
3
The word appears three times.
Try the problem first. Open one hint at a time.
Build a frequency map: each word is a key and its count is the value.
Use get with 0 while counting, and get with 0 again for the target.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor