Question: write a function consecutive(refstring) that takes a string refstring as a parameter and returns the number of disjoint substrings with consecutive characters. A substring

write a function consecutive(refstring) that takes a string refstring as a parameter and returns the number

write a function consecutive(refstring) that takes a string refstring as a parameter and returns the number of disjoint substrings with consecutive characters. A substring with 2 or more consecutive characters will be counted once. For example: consecutive('settle') will return 1 consecutive('printing') will return 0 consecutive( 'Yessss. Really ? Reaaaaaalllly?) will return return 4

Step by Step Solution

3.41 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!