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

Show thread
Follow

Expressions that evaluate to 100 

Then I came up with a solution in that took me ~5 minutes to write but with an execution time of 20s.

Show thread

But #bash can also do it in 46ms 

Show thread
Sign in to participate in the conversation
mastodon.cloud

[Notice Regarding the Transfer of the mstdn.jp / mastodon.cloud Services] We have received several inquiries showing interest in a transfer following the announcement of the end of the mstdn.jp and mastodon.cloud services. As a result of subsequently evaluating the situation and making preparations, we have decided that the corresponding services will be transferred to Sujitech, LLC. on June 30. Thank you.