1. सीखें
  2. /
  3. पाठ्यक्रम
  4. /
  5. Optimizing Code in Java

Connected

अभ्यास

Implementing a text analysis application

You're developing a text analysis application that needs to count the frequency of words in a document. You need to implement a solution with optimal time complexity for word lookups.

निर्देश

100 XP
  • Retrieve the currentCount for the word when it is already in the frequency map.
  • Increment it and update the frequency map the updated value.
  • If the word was not in the frequency map until now, add it.