โ† Amazon questions

Minimum Hops on Number Line

Filed under Amazon

Given a target integer 'target', find the minimum number of steps 'n' such that the sum of steps 1, 2, ..., n (with some steps negated) equals 'target'. Each step 'j' can be added or subtracted.

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.