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 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
Get step-by-step solutions from verified subject matter experts
