Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (14 sloc) 293 Bytes
seed <- unlist(strsplit("1113122113",""))
looksay <- function(s){
x <- rle(s)
as.character(c(rbind(x[[1]],x[[2]])))
}
for(i in 1:40){
seed <- looksay(seed)
}
print(length(seed))
## part 2
for(i in 1:10){
seed <- looksay(seed)
}
print(length(seed))
You can’t perform that action at this time.