Solution in Python 3

Explanation

First, we will declare an empty list, countOfSocks. In which we will store the count of each type of sock.

countOfSocks = []

Then, we will iterate over the set of ar through…

Shounak Lohokare

pretending to teach is one of the best way to learn.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store