https://www.codechef.com/viewsolution/31802948
Initially I’m finding out the sum of the all the lengths of the songs.
Then the HashMap contains the smallest length corresponding to the band. Then this Map is sorted based on the lengths.
Then I’m calculating the sum with each different band (with the min corresponding length)
with the ones already been listened to.
Meanwhile I’m subtracting these calculated values from the original sum which will be added to the answer multipled by the remaing songs.
But I’m still getting WA