拼多多笔试题Reach a Number--4行代码解决
LeetCode 754原题
Problem Desciption:
You are standing at position 0 on an infinite number line. There is a goal at position target.
On each move, you can either go left or right. During the n-th move (starting from 1), you take n steps.
Return the minimum number of steps required to reach the destination.