Fair Candy Swap, is a LeetCode problem. In this post we will see how we can solve this challenge in Python

Problem Description

If there are multiple answers, you may return any one of them. It is guaranteed an answer exists.

Example 1 :

Input: A = [1,1], B = [2,2] Output: [1,2]

Example 2 :

Input: A = [1,2], B = [2,3] Output: [1,2]

Example 3 :

Input: A = [2], B = [1,3] Output: [2,3]

Example 4 :

Input: A = [1,2,5], B = [2,4] Output: [5,4]

Note :

1 <= A.length <= 10000

1 &lt ....

You can find the full details of the problem Fair Candy Swap at LeetCode

Solution: Please check the main.py snippet for the solution.

This solution originally posted at: Github by @kamyu104