Task 9 of 9 · 0 solved · 9 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

Problem

10.1 HashMap — capstone: word counts

Read a count n, then n words, then one more word to look up.

Print: how many distinct words there were, how many times the lookup word appeared (0 if never), and the total of all the counts.

For 6, a b a c a b, a:

3
3
6

All three answers are order-independent — never print a map directly, since its order is not guaranteed.

time 1000 ms memory 256 Mb
Solution
Attempts: 0 A hint guides you to the fix — it never writes the code for you.
✦
Ready to check

Press «Submit» to run your code against the task's test cases — that is what sets your score. «AI review» is an optional second opinion: it reads your code — logic and style, not just the output — and suggests the next step without handing over the answer. It never changes your score.

Next module →
Working…