Clifford likes to write down sequence of positive integers. Everyday, he spend 3 hours writing from to on an infinite large whiteboard and then solve brilliant.org problems.
One fateful day, he woke up late and have little time left before he should log in to brilliant.org and continue his days streak. Instead of solving a practice problem to continue his streak, he wants to take a shortcut for writing the sequence. The method is to skip every same consecutive digits that occurs in the sequence to save some time.
Your mission is to help Clifford count how many digits he should write.
Original sequence :
Sequence after taking shortcut :
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Python 2.7: