Good morning! Here's your coding interview problem for today.
This problem was asked by Flipkart.
Starting from 0 on a number line, you would like to make a series of jumps that lead to the integer N.
On the i-th jump, you may move exactly i places to the left or right.
Find a path with the fewest number of jumps required to get from 0 to N.
Good morning! Here's your coding interview problem for today.
This problem was asked by Flipkart.
Starting from
0on a number line, you would like to make a series of jumps that lead to the integerN.On the
i-thjump, you may move exactlyiplaces to the left or right.Find a path with the fewest number of jumps required to get from
0toN.