Help me pair my socks Disclaimer: This challenge inspired by me trying to find pairs in a large pile of socks. 

Disclaimer: This is looking for a very different process and output to Help me sort my socks!. Please don't claim it as a duplicate until you've read both ;)



So, I have a huge pile of socks. Of course I keep them categorized by compatibility number. Compatible socks, which I can wear together, have the same number. (Of course, every programmer does this).

My super-convenient plot device quickly scans the pile and outputs an array of compatibility numbers for the pile. It looks a bit like this:

[2, 3, 3, 6, 0, 4, 9, 1, 6, 7, 11, 3, 13, 3, 
5, 12, 2, 1, 10, 2, 1, 11, 2, 13, 12, 10, 1, 
7, 0, 0, 12, 12, 6, 2, 13, 6, 10, 0, 0, 12, 
5, 0, 2, 3, 4, 0, 5, 8, 1, 6, 9, 7, 10, 14, 
10, 8, 3, 8, 9, 8, 5, 11, 7, 9, 9, 9, 7, 14, 
4, 2, 8, 14, 3, 11, 12, 14, 7, 13, 11, 13, 4, 
7, 5, 12, 3, 1, 12, 4, 5, 13, 2, 13, 2, 14, 1, 
13, 11, 1, 4, 8]


That's good data, but it's about as much use to me as scanning the pile myself by eye. What I want to know is how many compatible pairs I need to look for, and which are going to be 'odds', which I can discard for now.

In the above example, I am looking for these pairs of socks:

{3=&gt;4, 6=&gt;2, 2=&gt;4, 1=&gt;4, 11=&gt;3, 13=&gt;4, 12=&gt;4, 10=&gt;2, 7=&gt;3, 0=&gt;3, 5=&gt;3, 4=&gt;3, 9=&gt;3, 8=&gt;3, 14=&gt;2}


(4 pairs of number 3, 2 pairs of number 6 etc.)

And these numbers will have 'odd ones out'. When I've found all the pairs for these, I can discard the last one.

[0, 6, 10, 7, 2, 14] 




The challenge


Convert a list of compatible numbers to a count of pairs for each number and an array of 'odds'.


The pairs will be composed of a data structure (hash, or other) showing how many pairs can be made of each compatibility number (can be skipped if no pairs can be made).
The odds will be composed of a list of numbers which occur and odd number of times in the array.

The order of the outputs is not significant.
The size of my sock pile can, of course, be arbitrarily large.


The Rules


It's golf, make it short.
No standard loopholes.
Use any language you like.
Please include a link to an online interpreter.


Test Cases

Input: [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]

Output:

Pairs: {2=&gt;1, 3=&gt;1, 4=&gt;2, 5=&gt;2}

Odds: [1, 3, 5]



Input: [2, 3, 3, 6, 0, 4, 9, 1, 6, 7, 11, 3, 13, 3, 5, 12, 2, 1, 10, 2, 1, 11, 2, 13, 12, 10, 1, 7, 0, 0, 12, 12, 6, 2, 13, 6, 10, 0, 0, 12, 5, 0, 2, 3, 4, 0, 5, 8, 1, 6, 9, 7, 10, 14, 10, 8, 3, 8, 9, 8, 5, 11, 7, 9, 9, 9, 7, 14, 4, 2, 8, 14, 3, 11, 12, 14, 7, 13, 11, 13, 4, 7, 5, 12, 3, 1, 12, 4, 5, 13, 2, 13, 2, 14, 1, 13, 11, 1, 4, 8]

Output:

Pairs: {3=&gt;4, 6=&gt;2, 2=&gt;4, 1=&gt;4, 11=&gt;3, 13=&gt;4, 12=&gt;4, 10=&gt;2, 7=&gt;3, 0=&gt;3, 5=&gt;3, 4=&gt;3, 9=&gt;3, 8=&gt;3, 14=&gt;2}

Odds: [0, 6, 10, 7, 2, 14]



Input: [1, 2, 1, 2]

Output:

Pairs: {1=&gt;1, 2=&gt;1}

Odds: []



Input: [1,2,3]

Output: 

Pairs {}

Odds: [1,2,3]



Input: []

Output:

Pairs: {}

Odds: []
Perl 6, 46 bytes



{.kv.map(*=&gt;*+&gt;1),.keys.grep:{.{$^k}%2}}o*.Bag


Try it online!

Explanation

{                                      }o*.Bag  # Convert to Bag and feed into block
                 ,  # 2-element list
 .kv  # Key-value list (key is sock type, value is count)
    .map(       )  # Map to
         *=&gt;*+&gt;1   # Pair of sock type and count right-shifted by 1
                  .keys  # Keys (sock types)
                       .grep:  # Filter
                             {.{$^k}%2}  # Count is odd