A magical string s consists only of the numerical characters s itself.
The first few digits of the magical string s begin as follows:s =
Grouping the consecutive identical digits in s gives:
The lengths of these consecutive groups are:
Notice that the sequence formed by the group lengths is identical to the magical string s itself.
Given an integer n, return the number of times the character n characters of the magical string s.
Constraints:
A magical string s consists only of the numerical characters s itself.
The first few digits of the magical string s begin as follows:s =
Grouping the consecutive identical digits in s gives:
The lengths of these consecutive groups are:
Notice that the sequence formed by the group lengths is identical to the magical string s itself.
Given an integer n, return the number of times the character n characters of the magical string s.
Constraints: