This file contains 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
// Write a function, that checks whether the bomb explodes if the wires are cut in a given order. | |
// | |
// It should take an array of strings (colors of wires) as input and return a single boolean value | |
// as output (true if bomb explodes, false otherwise). | |
// | |
// Example of an input: | |
// ['red', 'green', 'blue', 'yellow', 'white', 'black'] | |
// | |
// Rules | |
// - After cutting the red wire, you can't cut the yellow one next. |