Question: Write a recursive function block_count(string) to return the number of blocks consisting of the same letter in the given input string. For example: >>> block_count('AABBCCCBBDDD')

Write a recursive function block_count(string) to return the number of blocks consisting of the same letter in the given input string. For example: >>> block_count('AABBCCCBBDDD') 5 >>> block_count('GGABAA') 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
