Object-Oriented Programming · Netflix · Medium
Create a WordCounter class that tracks word occurrences across text received in chunks. Text will arrive through several calls over time. For every chunk, break it into whitespace-delimited words and add those occurrences to the running totals. Expose a lookup method that reports how many times a particular word has appeared overall. Implement: add(text: str) -> None count(word: str) -> int (yield 0 when the word has not been seen) Constraints / defaults: Any whitespace…
Checking your access…