There are some stones on Bob's table in a row, and each of them can be red, green or blue, indicated by the characters `R`, `G`, and `B`.

Help Bob find the minimum number of stones he needs to remove from the table so that the stones in each pair of adjacent stones have different colours.

Examples:

```
"RGBRGBRGGB"   => 1
"RGGRGBBRGRR"  => 3
"RRRRGGGGBBBB" => 9
```

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def solution(stones):
	

Solutions:
def solution(s):
	st = [1 for i in range(1, len(s)) if s[i - 1] == s[i]]
	return sum(st)


def solution(s):
	r = s
	for i in range(9):
		r = r.replace('RR', 'R').replace('GG', 'G').replace('BB', 'B')
	return len(s) - len(r)


def solution(stones):
	return sum((a == b for (a, b) in zip(stones, stones[1:])))


from itertools import groupby

def solution(stones):
	return sum((len(list(l)) - 1 for (_, l) in groupby(stones)))


import re

def solution(stones):
	return sum((len(m[0]) - 1 for m in re.finditer('(.)\\1+', stones)))


def solution(stones):
	result = 0
	for i in range(len(stones) - 1):
		if stones[i] == stones[i + 1]:
			result += 1
	return result


def solution(stones):
	counter = -1
	previous_stone = stones[0]
	for stone in stones:
		if previous_stone == stone:
			counter += 1
		else:
			previous_stone = stone
	return counter