2007. Find Original Array From Doubled Array
https://leetcode.com/problems/find-original-array-from-doubled-array
Description
An integer array original
is transformed into a doubled array changed
by appending twice the value of every element in original
, and then randomly shuffling the resulting array.
Given an array changed
, return original
if changed
is a doubled array. If changed
is not a doubled array, return an empty array. The elements in original
may be returned in any order.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= changed.length <= 105
0 <= changed[i] <= 105
ac
Last updated