#
I have a list

group_list = [2,3,2,1]

Each element represents the number of people in a group.

And the group number is the index of each element

Group # Number of people

0 2

1 3

2 2

3 1

#
I want to now assign each individual its group number so i have a data structure like this

where a letter represents each person’s name and it is unique

Person Group #

A 0

B 0

C 1

D 1

E 1

F 2

G 2

H 1

Please how do i do this?