SBSandeep Bhaisora
HomeWritingAboutWorkProblemsJava Editor
GitHub
03 / WRITING

Writing

Posts tagged with "Algorithms"

Algorithms
Monotonic Stacks: From O(n²) to O(n)

Monotonic Stacks: From O(n²) to O(n)

20 December 2025
·8 min read

Reduce next greater element from O(n²) to O(n) with a monotonic decreasing stack.