#353 Aggregating Ad Campaign Impressions from a File
A file contains advertising campaigns and their impressions:
Campaign1;10;url1
Campaign3;100;url1,url2
Campaign2;1000;url2
Campaign3;20;url1,url2,url3
Campaign2;2000;url3
Campaign1;33;url1,url3
Campaign3;30;url1,url3
Campaign2;3000;url3
=======
Campaign1 - advertising campaign 1.
The second column is the number of impressions (1, 10, 1000, 20....)
url1 - the website where the impression occurred
Read the file and print the result as shown below, sorted by impressions in ascending order: advertising campaign, total number of impressions, and all websites where impressions occurred, separated by commas.
Campaign1;43;url1,url3
Campaign3;150;url1,url2,url3
Campaign2;6000;url2,url3
Question review
Sign in to start the dialogue
The mentor keeps the context of the current question and your previous messages.
Sign in
Available with Premium
This is just one of the solutions available with Premium. And more:
- 250+ advanced lectures
- 1300+ practice exercises
- 500+ solutions to problems from real interviews
- Personalized Java Hub certificates
- Expanded access to the AI mentor