For the best experience, increase the window size or view on a laptop or desktop device
Title | ||
|---|---|---|
Loading... | ||
For the best experience, increase the window size or view on a laptop or desktop device
Title | ||
|---|---|---|
Loading... | ||
You are given information on a Sock object such as color and foot (left or right). For example, consider the below as input:
1. black and left
2. pink and right
3. pink and left
4. black and right
5. black and right
You have to write a method which takes the above input and return the list of Sock object pairs (same color, different foot) which are:
(1, 4) *OR *(1, 5)
(2, 3)
Note if a sock is repeated in a pair then only return 1 pair where that sock is used.
You are given information on a Sock object such as color and foot (left or right). For example, consider the below as input:
1. black and left
2. pink and right
3. pink and left
4. black and right
5. black and right
You have to write a method which takes the above input and return the list of Sock object pairs (same color, different foot) which are:
(1, 4) *OR *(1, 5)
(2, 3)
Note if a sock is repeated in a pair then only return 1 pair where that sock is used.
Output