This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
We are developing a new board game, Thrilling Teleporters. | |
The board consists of consecutive squares from 0 to last_square, some of the spaces also contain Teleporters, which are given as comma delimited strings "from,to". | |
The game is played as follows: | |
1. Each turn, the player rolls a die numbered from 1 to die_sides. | |
2. The player moves forward the rolled number of squares. | |
3. The player stops at last_square if they reach it. | |
4. If the player finishes on a square with a teleporter, they are moved to where the teleporter points. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.EmptyStackException; | |
import java.util.Map; | |
import java.util.Stack; | |
public class Solution { | |
public static void main(String[] args) { | |
System.out.println(isCorrectBrackets("[{}]")); | |
System.out.println(isCorrectBrackets("[{]}")); | |
System.out.println(isCorrectBrackets("[{}{}{}{}]")); |
OlderNewer