1. IntroductionIn this tutorial, we’ll study two Java solutions for the Sock Merchant problem.2. The Sock Merchant ProblemIn the Sock Merchant problem, we have a merchant with a large pile of socks for sale that must be paired by color. We represent the socks’ colors by an array of integers, socks. The merchant’s goal is to determine how many pairs of matching socks there are.Therefore, we have three inputs:n: the number of socks in the collectionsocks: the array holding the colors of n socksk: the maximal color ID in this array, meaning 1