Given a string containing "<" and ">" only, balance the string so that every open has a close.
For example:
-
"<>" should return "<>"
-
"<" should return "<>"
-
">" should return "<>"
-
"><<><" should return "<><<><>>"
- The main
balanceAngles
function is inindex.js
. - I used a stack as a helper. That is defined in
anglesStack.js
- The tests are in
index.test.js
- Clone the repo
yarn install && yarn test