Given a list of tweets, the task is to find the user who has tweeted the most.
If multiple users are having the same number of tweets, then print all the users in alphabetical order of user names.
Read the input from the console. The first line of input should be the number of test cases Remaining lines of input should contain each test case input.
For each test case input:
First-line should contain the number of tweets. Followed by N lines, each containing the user name and tweet id separated by a space.
Find the user with max number of tweets. Print user name and the total number of tweets.
Input : 1 4 sachin tweet_id_1 sehwag tweet_id_2 sachin tweet_id_3 sachin tweet_id_4 Output : sachin 3 Input : 1 6 sachin tweet_id_1 sehwag tweet_id_2 sachin tweet_id_3 sehwag tweet_id_4 kohli tweet_id_5 kohli tweet_id_6 Output : kohli 2 sachin 2 sehwag 2
Code: Python Implementation for finding who tweeted the most
- Python String | find()
- numpy.find() in Python
- Python MongoDB - Find
- Python program to find all possible pairs with given sum
- Python | Find maximum value in each sublist
- Python | Find depth of a dictionary
- Find size of a list in Python
- Python | sympy.find() method
- Python | Find the closest Key in dictionary
- Python | Find last occurrence of substring
- Python | Find all triplets in a list with given sum
- Find Median of List in Python
- Find average of a list in python
- Python | Find whether all tuple have same length
- Python | Find Min/Max in heterogeneous list
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.