stack

A collection of 4 post

Iron Stick

Problem I am trying to cut several iron rods with a laser. For efficient operation, the iron rods are stacked from the bottom up, and the laser is fired vertically from above to cut the iron rods. The arrangement of the iron rod and laser satisfies the following conditions. An iron rod can only be…

Crane Game

Problem Jordi, a game developer, wants to make a crane puppet machine into a mobile game. In order to increase the fun of the game, Jordi tries to reflect the screen composition and rules in the game logic as follows. The game screen is an N x N square grid of 1 x 1 squares with a crane on the top…

Remove Parentheses Letter (Stack)

Problem Write a program that removes all characters between parentheses ( ) in the input string and prints only the remaining characters. input A string of parentheses is entered on the first line The length of the string does not exceed 100. output Only the remaining characters are printed…

Correct Parenthesis (Stack)

Problem If parentheses are entered, it outputs “YES” if it is a valid parenthesis, and “NO” if it is not correct. (())() This is the correct placement of the pair of parentheses, but (()())) is not the correct parentheses. input A string of parentheses is entered on the first line The maximum length…