set default value in funtion in python hackrank compress the string 21

Solutions on MaxInterview for set default value in funtion in python hackrank compress the string 21 by the best coders in the world

showing results for - "set default value in funtion in python hackrank compress the string 21"
Guadalupe
08 Aug 2019
1from itertools import groupby
2List=input()
3for c, items in groupby(List):    
4    print(tuple([len(list(items)),int(c)]), end=' ')
5
similar questions