Skip to content

DSC-Moi-University/nodetask1-Harun281

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding challange DSC MOI

This example project is written in Node, and tested with Jest.

Setup command

npm install

Run command

npm test

The assignment

John’s clothing store has a pile of loose socks where each sock i has a value denoting its color socks[i]. He wants to sell as many socks as possible, but his customers will only buy them in matching pairs. Two socks are a single matching pairs if their value are equal: socks[i] === socks[j] . Given an array socks which will hold all the socks value, how many pairs of socks can John sell?.

Input Format

We’re given an array socks where each item in the array socks[i] contains a value representing the sock color.

Sample input

An array of color values representing each sock’s color: socks = [10, 20, 20, 10, 10, 30, 50, 10, 20];

The tests are failing right now because we're not returning the correct string. Fixing this up will make the tests green.

About

nodetask1-Harun281 created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published