Uipath | 18th October | Online Assessments | Step Pattern

uipath · Question · Posted Oct 2022

Question 1 Step Pattern   HackerLand's highstreet has a number of skyscrapers of different heights. A contiguous sequence of buildings is called a "step pattern" if for every building of that contiguous sequence (or subarray), the height of that building is 1 less than the height of the building on its immediate left, i.e., height[i] - height[i - 1] -1, for all 0 < i < length of the subarray in consideration.   The task is to find the number ...

The full answer & interview discussion are available to premium members.

Log in Create a free account