Advent of Code, Day 6: better-wrapped presents


In well-wrapped presents, we only had one type of box -- (). What if we had several? (), {}, [], <>. We could do a much prettier job of wrapping!

Just like in well-wrapped presents, we need to make sure that every left bracket matches with a right bracket. This time, we also need to make sure that the right bracket matches the left one.

Write a program to tell if a string of brackets represents a possible nesting of boxes. Here are some examples for testing:

When you have an answer, copy your answer below for the following four strings. For example, if you think all are boxable except for the last one, you would write:

boxable
boxable
boxable
unboxable