Find the minimum moves to reach target n, taking exactly i steps in move i.
Unlock detailed company stats for this questionUpgrade
Given a target position n, find the minimum number of moves to land on it starting from 0. In the ith move you can take exactly i steps forward or backward. Constraint: -10^9 < n < 10^9. Examples: n=7 gives 5, n=3 gives 2.
Community answers
No answers contributed by the community yet.


