Thanks. It is grouping as expected. But it is returning empty [].
[ { "g": [], "b": [] }, { "g": [], "b": [] }, ... ]Probably this line is issue:
NewList[Dict['n'] - 1][Dict['m'][0]].append(Dict)You are probably decreasing n value. I have random number rather than increasing number. So, I have to match the n exactly not by decreasing.