For a Pocket Gems game event, four reward values may combine to a required score. Given an integer array nums and an integer target, return every unique quadruplet [a, b, c, d] such that a + b + c + d == target.
Each quadruplet must be returned in nondecreasing order, and the complete result must not contain duplicate quadruplets. The same array element may be used only once in a quadruplet, although equal values at different indices may be selected. Return an empty list when no valid quadruplet exists. The order of quadruplets in the result does not matter.
nums, an array of integers, and target, an integer.target.def four_sum(nums, target):