SCHLUMBERGER (SLB) Hiring | Off-Campus OA (2024) | Arrays
Question · Posted Jun 2026
Q1: Number of Smooth Descent Periods of a Stock Problem Statement You are given an integer array prices, where prices[i] represents the stock price on the i-th day. A smooth descent period is a contiguous subarray where every consecutive day's price decreases by exactly 1. Return the total number of smooth descent periods. Example Input prices = [3,2,1,4] Output 7 Explanation Smooth descent periods: [3] [2] [1] [4] [3,2] [2,1] [3,2,1] Total = 7
The full answer & interview discussion are available to premium members.
Log in Create a free account