At todays C++ meetup I was told a programming quiz:

Given the digits 1-9 (in that order), you can combine them with either '+', '-' or nothing.

Now find all of these mathematical terms, that evaluate to 100.

You can use any programming language and library you like and you have 1 hour to complete the task.

At first I came up with a solution in JavaScript.

time spent: 22min

execution time: ~170ms

loc: 21

Follow

But #bash can also do it in 46ms