September’s Brain Teaser

30 Sep, 2018 | 2 minutes read

We end every month summing up the all the things that happened in ⋮IWConnect. In other words we count the successes, the failures, the funny moments, the sad moments, new things that started, old that ended….  All of these things are summed up and put into our monthly Newsletter. Ok not only that, we also have one extra section covering a Brain Teaser which our employees solve each month.
This month we decided to share our Brain Teaser with all of you and give you an exclusive chance to win a SPA weekend for two in Ohrid.

Following is the task:

—–EXPRESSIONS START—–
fENAb0AJXF9deWFbKldfZllbREBDRlxRWWZGLFlee11dT0BdR0NTWHtEXFwsZURaX1h4R15XW35AWkNEYl1dT0Z+ZQ==
—–EXPRESSIONS END—–

After that create a program that will read that file and provide results from the mathematical expressions contained within.

The solution code should be generic and capable to process files having the same structure!
Do not use existing libraries or functions for mathematical expression evaluation. Code the logic behind it :)!

The program shall print the evaluation results on the console in the following format:

<<expression_1>>=<<result_1>>
<<expression_2>>=<<result_2>>

<<expression_n>>=<<result_n>>
Accumulator=<<result_1>>*<<result_2>>*…*<<result_n>>

Solution Hint: Don’t forget that “⋮IWConnect” will always give you the Exclusive capabilities to Unmask your goals!

Send us the value of the Accumulator along with the solution code.

The first one to send us the correct answer on marketing@iwconnect.com will be considered a winner. He/she will be invited at ⋮IWConnect to present their solution.

Good luck!

Solution

In attachment you can find the solution of the brain teaser. The purpose of the brain teasers is to enrich the knowledge, and the intention of this Brain Teaser was to:

  1. Learn how to encrypt/decrypt with logical binary XOR operation that is the only reversible binary operation
  2. Learn what is Infix notation and why it is hard to evaluate these expressions
  3. Learn what is Postfix notation  and why it is easy to evaluate these expressions
  4. Learn what is Shunting-yard algorithm that converts from Infix into Postfix notation

Thank you to all who sent us answers, unfortunately, none were correct…

Until next time 🙂