← All problemsSign in

Shubham and His Garden

Problem Description Shubham has a garden with N segments of plants arranged linearly. In each individual segment, the height of plants is in increasing order from left to right. The height of the first and last plants of ith segment are L[i] and R[i]. and the height of plants in the segment increases linearly by a constant k, i.e., height of plants in ith segment will be L[i], L[i]+k, L[i]+2*k,

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start