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
```

Difficulty: introductory

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):
    return sum(1 for i in range(len(s)) if i and s[i-1]==s[i])

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(r'(.)\1+',stones) )

from itertools import groupby


def solution(stones):
    return sum(len(list(grp))-1 for _, grp in groupby(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):
    # Do some magic
    num = 0
    for i in range(len(stones) - 1):
        if stones[i] == stones[i+1]:
            num += 1
            
    return num
#     if stones[0] == stones[1]:
#         stones.replace(stones[1], '', 1)
#     print(stones)


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