← Amazon questions
CodingReported in a candidate post, Aug 2019

Print number and its negation if both present

Filed under Amazon

Given an array of integers, find and print all numbers such that both the number 'a' and its negation '-a' are present in the array. The solution must use O(1) auxiliary space complexity.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.