← SAP questions
CodingMedium

Minimum Number of Taps to Open to Water a Garden

Filed under SAP · Also reported at BNY Mellon, Morgan Stanley

There is a one-dimensional garden on the x-axis from 0 to n. You are given n and an integer array ranges of length n + 1, where the i-th tap can water the area [i - ranges[i], i + ranges[i]]. Return…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related SAP questions

Collected from public candidate posts and coding forums. Updated Nov 2026.