I was solving a programming puzzle and came across this solution by someone. I don't understand why the * is used.
a = [*map(len,input().replace(" ","").replace("12","1 2").replace("21","2 1").split(" "))]
I was solving a programming puzzle and came across this solution by someone. I don't understand why the * is used.
a = [*map(len,input().replace(" ","").replace("12","1 2").replace("21","2 1").split(" "))]