For the best experience, increase the window size or view on a laptop or desktop device
Last updated: Pending
Title | ||
|---|---|---|
Loading... | ||
1/1
No questions are available yet
For the best experience, increase the window size or view on a laptop or desktop device
Title | ||
|---|---|---|
Loading... | ||
Given a list of people, write a method to return a list of pairs such that each person is paired with another.
Example:
Input: {steven, john, amy, wuyifan}
expected output: {steven, john}, {amy, wuyifan}
Follow up:
Use the method multiple times and ensure the paring for each person is different each time.
Example output of the second call: {steven,amy}, {john, wuyifan}
Follow up 2: Support random pairing.
Given a list of people, write a method to return a list of pairs such that each person is paired with another.
Example:
Input: {steven, john, amy, wuyifan}
expected output: {steven, john}, {amy, wuyifan}
Follow up:
Use the method multiple times and ensure the paring for each person is different each time.
Example output of the second call: {steven,amy}, {john, wuyifan}
Follow up 2: Support random pairing.
Output