How to achieve the results for {2:1, 3:1, 2:2, 1:1, 1:2, 3:2}
CodePudding user response:
In the Window. PartitionByCodePudding user response:
LST=,3,2,1,1,3 [2]
A=[]
B={}
For x in LST:
B=b [x] [x] + 1 if b.g et (x) the else 1
A.a ppend ((x, (b [x] if b.g et 1) (x) the else))
Print (a)