# Task
 You are given a string `s`. Let's call its substring a group, if all letters in it are adjacent and the same(such as `"aa","bbb","cccc"`..). Let's call the substiring with 2 or more adjacent group a big group(such as `"aabb","bbccc"`...).
 
 Your task is to count the number of `big groups` in the given string.

# Example

 For `s = "ccccoodeffffiiighhhhhhhhhhttttttts"`, the result should be `3`.
 ```
The groups are "cccc", "oo", "ffff", "iii", "hhhhhhhhhh", "ttttttt"
The big groups are "ccccoo", "ffffiii", "hhhhhhhhhhttttttt", 
3 substrings altogether.```

 For `s = "gztxxxxxggggggggggggsssssssbbbbbeeeeeeehhhmmmmmmmitttttttlllllhkppppp"`, the result should be `2`.
 ```
The big groups are :
"xxxxxggggggggggggsssssssbbbbbeeeeeeehhhmmmmmmm"
and 
"tttttttlllll" ```

 For `s = "soooooldieeeeeer"`, the result should be `0`.
 
 There is no `big group` exist.
 
# Input/Output


 - `[input]` string `s`

  A string of lowercase Latin letters.


 - `[output]` an integer

  The number of big groups.

Difficulty: EASY
Starter code: def repeat_adjacent(string):
	

Solutions:
from re import findall
repeat_adjacent = lambda s: len(findall('((.)\\2+(?!\\2)){2,}', s))


import re
repeat_adjacent = lambda s: sum((len(set(i[0])) > 1 for i in re.findall('((([a-z])\\3+){2,})', s)))


from functools import partial
from itertools import groupby
from operator import ne

def repeat_adjacent(s):
	xs = [sum((1 for _ in grp)) for (key, grp) in groupby(s)]
	return sum((key and sum((1 for _ in grp)) > 1 for (key, grp) in groupby(xs, key=partial(ne, 1))))


from itertools import groupby

def repeat_adjacent(string):
	return sum((1 for (k, g) in groupby((min(2, len(list(grp))) for (_, grp) in groupby(string))) if k == 2 and len(list(g)) > 1))


from itertools import groupby

def repeat_adjacent(string):
	return sum((1 for (k, g) in groupby((sum((1 for _ in g)) for (_, g) in groupby(string)), key=lambda l: l > 1) if k == True and next(g) and next(g, None)))


def repeat_adjacent(string):
	a = list(string)
	b = []
	if len(a) >= 2:
		if a[1] == a[0]:
			b.append(1)
		for i in range(2, len(a)):
			if a[i - 1] == a[i] and a[i - 1] != a[i - 2]:
				b.append(1)
			elif a[i - 1] != a[i]:
				b.append(0)
		c = []
		if b[0] == 1:
			c.append(1)
		for i in range(1, len(b)):
			if b[i] == 1:
				c.append(1)
			elif b[i - 1] == 0:
				c.append(0)
		k = 0
		for i in range(1, len(c) - 1):
			if c[i] == 1 == c[i - 1] and c[i + 1] == 0:
				k += 1
		if c[len(c) - 1] == 1 == c[len(c) - 2]:
			k += 1
	else:
		k = 0
	return k


from re import findall

def repeat_adjacent(s):
	return len(findall('((.)\\2+(?!\\2)){2,}', s))


def repeat_adjacent(string):
	(a, b, c, d) = (0, [], '', 0)
	for i in range(a, len(string) - 1):
		if string[i] == string[i + 1]:
			continue
		else:
			b.append(string[a:i + 1])
			a = i + 1
	b.append(string[-(len(string) - a):])
	for j in b:
		if len(j) > 1:
			c += j
		else:
			c += '*'
	for k in c.split('*'):
		if len(set(k)) > 1:
			d += 1
	return d


import re
from itertools import groupby

def repeat_adjacent(s):
	return sum((x and next(y) and bool(next(y, 0)) for (x, y) in groupby((x[0] for x in re.findall('((.)\\2*)', s)), key=lambda x: len(x) > 1)))


def repeat_adjacent(string):
	check = ''
	big_group = []
	for i in range(1, len(string) - 1):
		if string[i - 1] == string[i] or string[i] == string[i + 1]:
			check += string[i]
		else:
			if len(set(check)) > 1:
				big_group.append(check)
			check = ''
	if len(set(check)) > 1:
		big_group.append(check)
	return len(big_group)