# Separate Black and White Balls (LeetCode 3163)
Practice note for coding interviews.
## Approach
Monotonic stack for next-greater / next-smaller.
## Complexity
State time and space clearly; call out edge cases (empty input, duplicates, extremes).
## Practice tip
Rehearse the explanation out loud. An [here](https://www.linkjob.ai/) helps keep structure under time pressure.
Disclosure: personal study notes; I am affiliated with Linkjob AI.