Hackerrank – Sock Merchant

Hackerrank – Problem Statement

A description of the problem can be found on Hackerrank.

Solution

I created groups of socks with same color. Then for each of the group I calculated sock pairs – number_of_socks / 2. The result is the count of all pairs.

I created solution in:

All solutions are also available on my GitHub.

Java

JavaScript

Scala

Ruby

Leave a Reply

Your email address will not be published. Required fields are marked *