Find Original Array From Doubled Array
A medium-tier problem at 40% community acceptance, tagged with Array, Hash Table, Greedy. Reported in interviews at Verily and 1 others.
Find Original Array From Doubled Array pops up at Verily and Accenture, and it's a brutal 40% acceptance rate for a Medium. The trap is obvious: you see a doubled array and think 'just divide by 2' or 'pair them greedily'. Both fail hard. The real trick requires the right data structure and processing order to reconstruct the original without getting stuck on numbers that should pair with larger elements. If you hit this on a live OA and the greedy path implodes, StealthCoder surfaces the working approach in seconds, invisible to the proctor.
Companies that ask "Find Original Array From Doubled Array"
Find Original Array From Doubled Array is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.
Get StealthCoderThe problem looks like array manipulation but it's actually a constraint satisfaction puzzle. You have to match each element in the doubled array to an original element such that one is exactly double the other, and every number gets used exactly once. A naive greedy approach fails because picking a pairing too early can lock you out of valid solutions later. The winning pattern: sort the array, use a hash table to track remaining counts, and process elements in order so smaller numbers get paired first. This forces the correct pairing logic and avoids dead ends. Common pitfall is forgetting to handle zeros and negative numbers specially. When the interview assessment times out or shows 'pairing impossible' on cases you thought should work, you've hit the ordering trap. That's where StealthCoder becomes your hedge.
Pattern tags
You know the problem.
Make sure you actually pass it.
Find Original Array From Doubled Array recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Find Original Array From Doubled Array interview FAQ
Why doesn't greedy matching work here?+
Greedy picks any available double of the current element, which can exhaust a needed number for a later pairing. Sorting first ensures you always process smaller numbers before larger ones, forcing the only valid matching. Without sort order, you get stuck.
Do I really need a hash table for this?+
Yes. You need to track remaining element counts and decrement them as you form pairs. A hash map lets you check and update in constant time. Array lookup and shifting would time out on large inputs.
Is this still asked at companies like Verily?+
Verily and Accenture both ask it. 40% acceptance rate means most candidates fail it in their first attempt. It's not a rarity; it's a screening filter.
How does this relate to the other topics listed?+
Array and Sorting set up the framework. Hash Table handles the pairing logic and count tracking. Greedy is the tempting wrong approach that the problem is designed to catch.
What's the time complexity I should aim for?+
O(n log n) due to sorting, then O(n) for the pairing pass. Hash table operations are O(1) average. This is optimal for the constraint; anything slower will time out on large arrays.
Want the actual problem statement? View "Find Original Array From Doubled Array" on LeetCode →