Amazon Interview Question for SDE1s
- 1of 1 vote
In a garden, there are several apples trees planted in a grid format. Each point (i,j) in the grid has |i| + |j| apples.
Allie can buy a square plot centred at (0,0). Find the minimum perimeter of the plot (1 unit having length = 1) such that she can collect at
least X apples. All plants on the perimeter of the plot are also included.
- bertram_gilfoyle June 27, 2019 in India
Input = 1 Output = 8 input = 11 Output = 8 Input = 13 Output = 16
| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm