Algorithm · Square · Easy
You are given three parallel lists that describe a collection of socks: ids — a list of distinct integers, where each integer uniquely identifies one sock. colors — a list of strings holding the colour of each sock. feet — a list of strings containing either "left" or "right", indicating which foot the sock is made for. Every sock may be paired with at most one other sock. A pairing is only valid when: The two socks share the same colour. One sock is for the left foot and…
Checking your access…