Skip to content
the poor coder

Home / Topics / #stack

#stack

15 posts
2021

Leetcode - Crawler Log Folder Solution

The Leetcode file system keeps a log each time some user performs a change folder operation. The operations are described below: "../" : Move to the parent folder of the current folder. (If you are already in the main…

leetcodestack1 min read
2021

Leetcode - Make The String Great Solution

Given a string s of lower and upper case English letters. A good string is a string which doesn't have two adjacent characters s[i] and s[i + 1] where: 0 <= i <= s.length - 2 s[i] is a lower-case letter and s[i + 1] is…

2021

Leetcode - Asteroid Collision Solution

We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning…

leetcodestack2 min read
2021

Leetcode - Baseball Game Solution

You are keeping score for a baseball game with strange rules. The game consists of several rounds, where the scores of past rounds may affect future rounds' scores. At the beginning of the game, you start with an empty…

leetcodestack3 min read
2021

Leetcode - Min Stack Solution

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Implement the MinStack class: MinStack() initializes the stack object. void push(val) pushes the element val onto the…

2021

Leetcode - Valid Parentheses Solution

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open…

ESC