Skip to content

Commit 5d607bf

Browse files
authored
Update 2284-Sender-With-Largest-Word-Count.md
1 parent e15cea7 commit 5d607bf

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

dsa-solutions/lc-solutions/2200-2299/2284-Sender-With-Largest-Word-Count.md

+4-16
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ sidebar_position: 85
1616
---
1717

1818
## Problem Statement
19-
In this tutorial, we will solve the Sender With Largest Word Count problem . We will provide the implementation of the solution in Python, Java, and C++.
19+
In this tutorial, we will solve the Sender With Largest Word Count problem. We will provide the implementation of the solution in Python, Java, and C++.
2020

2121
### Problem Description
2222

@@ -29,7 +29,7 @@ Return the sender with the largest word count. If there is more than one sender
2929
### Examples
3030

3131
**Example 1:**
32-
Input: messages = ["Hello userTwooo","Hi userThree","Wonderful day Alice","Nice day userThree"], senders = ["Alice","userTwo","userThree","Alice"]
32+
Input: messages = ["Hello userTwooo", "Hi userThree", "Wonderful day Alice", "Nice day userThree"], senders = ["Alice", "userTwo", "userThree", "Alice"]
3333
Output: "Alice"
3434
Explanation: Alice sends a total of 2 + 3 = 5 words.
3535
userTwo sends a total of 2 words.
@@ -57,11 +57,7 @@ Since there is a tie for the largest word count, we return the sender with the l
5757

5858
The problem can be solved using a brute force approach or an optimized Technique.
5959

60-
<Tabs>
61-
<tabItem value="Brute Force" label="Brute Force">
62-
63-
### Approach 1:Brute Force (Naive)
64-
60+
## Approach 1:Brute Force (Naive)
6561

6662
Count Words for Each Sender:
6763

@@ -180,10 +176,7 @@ def largest_word_count(messages, senders):
180176
- Space Complexity: $O(k)$
181177
- for storing word counts of senders.
182178

183-
</tabItem>
184-
<tabItem value="Optimized approach" label="Optimized approach">
185-
186-
### Approach 2: Optimized approach
179+
## Approach 2: Optimized approach
187180

188181
Optimized Approach: Word Count Calculation:
189182
For each message, split the message string and count the words. This step is O(1) in complexity since the maximum length of a message is fixed.
@@ -292,9 +285,6 @@ def largest_word_count(messages, senders):
292285

293286
- This approach is efficient and straightforward.
294287

295-
296-
297-
298288
## Video Explanation of Given Problem
299289

300290
<Tabs>
@@ -332,8 +322,6 @@ def largest_word_count(messages, senders):
332322
</Tabs>
333323

334324

335-
336-
337325
---
338326

339327
<h2>Authors:</h2>

0 commit comments

Comments
 (0)