#353 Aggregating Ad Campaign Impressions from a File

Companies:
GeniusGroup
Themes:
JavaCollections & GenericsIO & NIOPractice

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

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in