38 Count and Say
The count-and-say sequence is the sequence of integers beginning as follows:
Note: The sequence of integers will be represented as a string
The biggest part here was discovering how to count duplicates and not go over range of the vector. Basically, I counted the number of duplicates, appended it to a new string, and then moved on to analyize the next two characters. Dup is always reset to 1, because it is clear there is at least of the numbers.
Last updated