Skip to content

JKUATSCOSIT/SCOSITchallenge2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

SCOSITchallenge2

John's clothing store has a pile of n loose socks where each sock i is labeled with an integer, ci , denoting its color. He wants to sell as many socks as possible, but his customers will only buy them in matching pairs. Two socks, i and j, are a single matching pair if ci=cj.
Given n and the color of each sock, how many pairs of socks can John sell?
n = [10, 20, 20, 10, 10, 30, 50, 10, 20]
TASK:
Create a program to accept n a list of socks c1,c2,....cn
Return the number of matching pairs John can sell

// Good luck!

Releases

No releases published

Packages

No packages published

Languages