Posts with tag 'stack'

Repeated Deletion Sequel

less than 1 minute read

Given a string s and an integer k, repeatedly delete the earliest k consecutive duplicate characters.

Stack Sequence

1 minute read

Given a list of distinct integers pushes, and another list of integers pops, return whether this is a valid sequence of stack push and pop actions.

Interval Union

less than 1 minute read

Given a two-dimensional integer list intervals representing unsorted inclusive intervals, return their union in sorted order.

Balanced Brackets Sequel

less than 1 minute read

Given a string s containing round, curly, and square open and closing brackets, return whether the brackets are balanced.

Word Machine

1 minute read

You are given a list of strings ops where each element is either:

Unobstructed Buildings

1 minute read

You are given a list of integers heights representing building heights. A building heights[i] can see the ocean if every building on its right has shorter he...

Unix Path Resolution

1 minute read

Given a Unix path, represented as a list of strings, return its resolved version.

Tree Traversal

1 minute read

You are given a tree root and a list of strings moves consisting of "RIGHT", "LEFT" and "UP". Starting from root, traverse the tree by performing each move i...

Text Editor

less than 1 minute read

Given a string s representing characters typed into an editor, with "<-" representing a backspace, return the current state of the editor.

Repeated Deletion

less than 1 minute read

Given a string s, repeatedly delete the earliest consecutive duplicate characters.

Minimum Bracket Addition

less than 1 minute read

Given a string s containing brackets ( and ), return the minimum number of brackets that can be inserted so that the brackets are balanced.

Balanced Brackets

less than 1 minute read

You’re given a string s consisting solely of "(" and ")". Return whether the parentheses are balanced.

Back to top ↑