Solve this printing the pair into a proper list

You are provided with input like
[ jeans, slim jeans]
[jeans , short jeans]
[ men, jeans]
[men , t shirts]
[ women, tops]

Then output should look like -
Men
---------Jeans
-------------------Slim jeans
-------------------Short jeans
---------T shirt
Women
---------tops

Consider -------------- as blank space

Comments (2)