In this Kata, you will be given an array of strings and your task is to remove all consecutive duplicate letters from each string in the array.

For example: 

  * `dup(["abracadabra","allottee","assessee"]) = ["abracadabra","alote","asese"]`. 
  
  * `dup(["kelless","keenness"]) = ["keles","kenes"]`.

Strings will be lowercase only, no spaces. See test cases for more examples.

~~~if:rust
For the sake of simplicity you can use the macro 'vec_of_string' to create a Vec with an array of string literals.
~~~

Good luck!

If you like this Kata, please try:

[Alternate capitalization](https://www.codewars.com/kata/59cfc000aeb2844d16000075)

[Vowel consonant lexicon](https://www.codewars.com/kata/59cf8bed1a68b75ffb000026)

Source: codewars | Difficulty: EASY
Tags: String algorithms

Data structures

Starter code: def dup(arry):
	

Solutions:
from itertools import groupby

def dup(arry):
	return [''.join((c for (c, grouper) in groupby(i))) for i in arry]


import re

def dup(arry):
	return list(map(lambda s: re.sub('(\\w)\\1+', '\\1', s), arry))


def dup(arry):
	array_new = []
	for string in arry:
		string_new = ''
		prev = None
		for char in string:
			if char != prev:
				string_new += char
			prev = char
		array_new.append(string_new)
	return array_new


def dup(arr):
	(a, res) = (0, [x[0] for x in arr])
	for string in arr:
		for x in range(1, len(string)):
			if string[x] != string[x - 1]:
				res[a] += string[x]
		a += 1
	return res


from itertools import groupby

def dup(strings):
	return [''.join((c for (c, _) in groupby(s))) for s in strings]


import re

def dup(lst):
	return [re.sub('(.)\\1+', '\\1', stg) for stg in lst]


import re

def dup(xs):
	return [re.sub('(.)\\1+', '\\1', x) for x in xs]


def f(s):
	return ''.join((s[i] for i in range(len(s) - 1) if s[i] != s[i + 1])) + s[-1]

def dup(arry):
	return [f(s) for s in arry]


from itertools import groupby

def dup(array):
	return list(map(remove_dup, array))

def remove_dup(string):
	return ''.join((single for (single, _) in groupby(string)))


def dup(arry):
	stack = []
	output = []
	for item in arry:
		for i in item:
			if len(stack) == 0 or (len(stack) >= 1 and i != stack[-1]):
				stack.append(i)
			else:
				continue
		output.append(''.join(stack))
		stack = []
	return output