Leetcode 754 (Medium) Reach a Number in Javascript

preview_player
Показать описание
You are standing at position 0 on an infinite number line. There is a goal at the 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.

Рекомендации по теме
visit shbcf.ru