Feb. 23, 2022, 10:59 a.m. |

DEV Community dev.to

There is a large pile of socks that must be paired by color. Given an array of integers representing the color of each sock, determine how many pairs of socks with matching colors there are.





Example


n = 7

ar = [1, 2, 1, 2, 1, 3, 2]

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 …

algorithms javascript programming sales tutorial

SOC 2 Manager, Audit and Certification

@ Deloitte | US and CA Multiple Locations

Information Security Engineers

@ D. E. Shaw Research | New York City

Security Solution Architect

@ Civica | London, England, United Kingdom

Information Security Officer (80-100%)

@ SIX Group | Zurich, CH

Cloud Information Systems Security Engineer

@ Analytic Solutions Group | Chantilly, Virginia, United States

SRE Engineer & Security Software Administrator

@ Talan | Mexico City, Spain