Skip to content

Instantly share code, notes, and snippets.

View ericdiazjr21's full-sized avatar
💭
Coding.

Eric Diaz ericdiazjr21

💭
Coding.
View GitHub Profile
@ericdiazjr21
ericdiazjr21 / test
Created February 27, 2019 01:13
test
test
@ericdiazjr21
ericdiazjr21 / gist:7c7eafdc00e0bfdb10aedf74c1aee685
Last active January 2, 2019 16:07
HackerRank Solution code #1
John works at a clothing store. He has a large pile of socks that he must pair by color for sale. Given an array of integers representing the color of each sock, determine how many pairs of socks with matching colors there are.
For example, there are socks with colors . There is one pair of color and one of color . There are three odd socks left, one of each color. The number of pairs is .
Function Description
Complete the sockMerchant function in the editor below. It must return an integer representing the number of matching pairs of socks that are available.
sockMerchant has the following parameter(s):