Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Count and Say
Bookmark
Iterative
Recursive
Regex
Input
n = 2
n = 4
n = 6
Custom
n
=
2
current
1
0
current
1
0
Term 1 of 2
current
1
0
Term 2 of 2
current
1
0
Term 2 of 2
current
1
0
i
ch = '1'
Term 2 of 2
current
1
0
i
'1' x 1
Term 2 of 2
current
1
0
next
1
1
Term 2 of 2
current
1
1
0
1
Term 2 of 2
current
1
1
0
1
result =
"11"
algo
master
.
io
Step:
Start: build the count-and-say sequence up to term 2
0 / 7
Input
n = 2
n = 4
n = 6
Custom
n
=
2
0 / 7
algo
master
.
io
Step:
Start: build the count-and-say sequence up to term 2