Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
I lost hours focusing on ordered_set pattern which was wrong ... please move that problem to "monotonic_stack"

lejafilip

Dec 15, 2024

Harder thing is to find a monotonic_stack usage.

0

0

Comments
Comments
P
peter 9 months ago

It can also be done with just an ordered set:

class OrderedSetJS { constructor(comparator = (a, b) => a - b) { this.set = []; this.comparator = comparator; } check132pattern(element) { const index = this.set.findInde...

On this page