Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2055. Plates Between Candles
Given a string of '*' (plates) and '|' (candles), answer many queries [l,r] by counting plates that lie strictly between at least one candle to their left and one to their right inside the substring (i.e., between the leftmost and rightmost candle in the range). The algorithmic challenge is to preprocess the string (e.g., nearest-candle indices and prefix sums) so each query can be answered efficiently.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.