# Task
 Yesterday you found some shoes in your room. Each shoe is described by two values:
```
type indicates if it's a left or a right shoe;
size is the size of the shoe.
```
 Your task is to check whether it is possible to pair the shoes you found in such a way that each pair consists of a right and a left shoe of an equal size.

# Example

 For:
```
shoes = [[0, 21], 
         [1, 23], 
         [1, 21], 
         [0, 23]]
         ```
the output should be `true;`

 For:
```
shoes = [[0, 21], 
         [1, 23], 
         [1, 21], 
         [1, 23]]
         ```
the output should be `false.`

# Input/Output

 - `[input]` 2D integer array `shoes`

 Array of shoes. Each shoe is given in the format [type, size], where type is either 0 or 1 for left and right respectively, and size is a positive integer.

 Constraints: `2 ≤ shoes.length ≤ 50,  1 ≤ shoes[i][1] ≤ 100.`

 - `[output]` a boolean value

   `true` if it is possible to pair the shoes, `false` otherwise.

Difficulty: introductory

Starter code:

def pair_of_shoes(shoes):
	

Solutions:
def pair_of_shoes(a):
    return sorted(s for lr, s in a if lr == 1) == sorted(s for lr, s in a if lr == 0)

from collections import defaultdict
def pair_of_shoes(shoes):
    sz = defaultdict(list)
    for i in shoes:
        sz[i[1]].append(i[0])
    return all( (i[1].count(1) == i[1].count(0)) for i in sz.items())

from collections import defaultdict


def pair_of_shoes(shoes):
    shoe_counts = defaultdict(int)
    for shoe_type, shoe_size in shoes:
        shoe_counts[shoe_size] += 1 if shoe_type else -1
    return all(a == 0 for a in shoe_counts.values())


from collections import defaultdict

def pair_of_shoes(shoes):
    D = defaultdict(lambda:defaultdict(int))
    for type, size in shoes: D[size][type] += 1
    return all(v[0] == v[1] for v in D.values())

pair_of_shoes=lambda s:all([s.count([i[0]^1,i[1]])==s.count(i)for i in s])

def pair_of_shoes(shoes):
    return not sum((size * (-1)**side) for side, size in shoes)

from collections import Counter

def pair_of_shoes(shoes):
    c = Counter()
    for lr, size in shoes:
        c[size] += 1 if lr else -1
    return not any(c.values())

def pair_of_shoes(shoes):
    l = [i for i, j in shoes]
    m = [j for i, j in shoes]
    return sum(m.count(i) % 2 == 0 for i in set(m)) == len(set(m)) and l.count(0) == l.count(1)


from collections import Counter

def pair_of_shoes(shoes):
    def count_of_type(type_):
        return Counter(n for t, n in shoes if t == type_)
    return count_of_type(0) == count_of_type(1)

S,pair_of_shoes=lambda a,T:sorted(s for t,s in a if t-T),lambda a:S(a,0)==S(a,1)