3 lines
143 B
Text
3 lines
143 B
Text
|
|
RunLengthEncode[x_List]:=(Through[{First,Length}[#]]&)/@Split[x]
|
||
|
|
LookAndSay[n_,d_:1]:=NestList[Flatten[Reverse/@RunLengthEncode[#]]&,{d},n-1]
|