← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
You are given a list of socks. Each sock is represented by a tuple (color, foot) where color is a string and foot is either "L" (left) or "R" (right). A valid pair consists of two socks of the same color but opposite feet (one left and one right). Your task is to write a function that returns the maximum number of valid sock pairs that can be formed from the given list. You cannot reuse a sock in more than one pair.