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.