In this Kata, we are going to determine if the count of each of the characters in a string can be equal if we remove a single character from that string.

For example:
```
solve('abba') = false -- if we remove any character, the count of each character will not be equal.
solve('abbba') = true -- if we remove one b, the count of each character becomes 2.
solve('aaaa') = true -- if we remove one character, the remaining characters have same count.
solve('wwwf') = true -- if we remove f, the remaining letters have same count.
```
More examples in the test cases. Empty string is not tested.

Good luck!

Source: codewars | Difficulty: EASY
Tags: String algorithms

Starter code: def solve(s):
	

Solutions:
from collections import Counter

def solve(s):
	return any((len(set(Counter(s.replace(c, '', 1)).values())) == 1 for c in s))


from collections import Counter

def solve(s):
	c = Counter(s).values()
	(cVal, mi, ma) = (Counter(c), min(c), max(c))
	return len(cVal) <= 2 and (len(cVal) == 1 and (1 in cVal or 1 in cVal.values()) or mi == cVal[mi] == 1 or (mi == ma - 1 and cVal[ma] == 1))


from collections import Counter

def solve(s):
	return any((len(set(Counter(s[:i] + s[i + 1:]).values())) == 1 for i in range(len(s))))


def solve(s):
	a = [s.replace(s[y], '', 1) for (y, x) in enumerate(s)]
	return any((len(sorted(set([x.count(c) for c in x]))) == 1 for x in a))


from collections import Counter

def solve(stg):
	c = tuple(Counter(stg).values())
	(mn, mx) = (min(c), max(c))
	(l, cmx) = (len(c), c.count(mx))
	return 1 in (l, mx) or mx - mn == cmx == 1 or l - cmx == mn == 1


def solve(s):
	s = list(s)
	for i in range(len(s)):
		temp = s.copy()
		temp.pop(i)
		if all((temp.count(k) == temp.count(temp[0]) for k in temp)):
			return True
	return False


from collections import Counter

def solve(s):
	c = Counter(s)
	(l, cc, mi, ma, su) = (len(c), Counter(c.values()), min(c.values()), max(c.values()), sum(c.values()))
	return len(c) == 1 or su - ma * l == 1 or mi == 1 == su - ma * l + ma or (cc[ma] == 1 == ma - mi)


from collections import Counter

def solve(s):
	frequencies = [x[1] for x in Counter(s).most_common()]
	return len(frequencies) == 1 or (len(set(frequencies[:-1])) == 1 and frequencies[-1] == 1) or (frequencies[0] == frequencies[1] + 1 and len(set(frequencies[1:])) == 1)


from collections import Counter

def solve(s):
	c = Counter(s)
	for key in c.keys():
		temp = Counter(key)
		check = c - temp
		if len(set(check.values())) < 2:
			return True
	return False