LeetCode Question · Aug 2024

Uber OA

2 upvotes 301 views

Question Details

have an array , we have to make it a incresing stair step or decresing stair step by adding to it find the minimum number to be added to all,...

Full Details

have an array , we have to make it a incresing stair step or decresing stair step by adding to it find the minimum number to be added to all, each element should differ by only 1
tower = [1,4,3,2] ans = 4 as we can add 4 to first element, then tower = [5,4,3,2]
tower = [5,7,9,4,11] ans = 9 as tower = [7,8,9,10,11]

About This Question

This is a reported interview question from a uber interview for a swe role during the oa round reported in 2024.

It covers the following topics: Arrays .

Topics