Grouping a list of values 0 and -1

Hello Student,

Your problem looks very similar to this thread: