You are at position 0 on an infinite number line. On the n-th move, you take n steps either left or right. Find the minimum number of moves required to reach a given target position.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.