your partner's solution does not take care of the case where the userID has a single occurence AND has a query of '-'.
my soln offers one way of taking care of this..
also for my soln, move j++ inside the if block that has the print statement. i am assuming j counts the number of userID (blocks) printed..
|