community
cancel
Showing results for 
Search instead for 
Did you mean: 
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Weekly Challenge
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Unable to display your progress at this time. Please try again a little later, or contact an administrator if you continue to see this error.
Getting started with Designer? | Start your journey with our new Learning Path!

Challenge #183: Roman Numeral Math

Asteroid

A solution to last week's challenge can be found here.

 

This week's challenge was shared by @LordNeilLord  and @JReid  from an original post by @AnandKumar1. Thanks to all of you for sharing this challenge!

 

This challenge includes two inputs: 1) An equation written in Roman numerals and 2) a look-up table of certain Roman numerals. Solve the equation and return the answer as an integer.

 

asset.gif

 

 

 

 

 

 

 

 

 

 

 

Update: Start file updated on 10/1/2019

 

Asteroid

Feels good when your question comes in weekly challenge. Lets see how many different solutions will come

 

Alteryx Certified Partner

I've been waiting for this one to come up

Asteroid

I get a different result - could be me - but you might want to check it.

 

Spoiler
image.png
Asteroid

I got a different answer, but I was a little confused about how the order of operations should have been handled given how the formula was given. 
[1]*[3]/([5]+[7]-[9]) vs ([1]*[3]/[5])+[7]-[9] (both were far off from the provided answer, which was close to just [1]*[3] less ~300 or so

 

Spoiler
ZhSOL.png

 

 

Looks like The provided solution took ((1732*79)/9 )+(1-7)/9 and took the /9 off the first set of brackets  after converting -6/9 --> -54.
136828-54=136744. off by ~1

I don't know how the "solution" was generated but it sure didn't follow PEMDAS rules.  Anywho, another lunch break given over to another weekly challenge.  I think I need to clean up and publish my macro within my organization.

 

Spoiler
183.png

Edit:  Once I had the formula with the correct Hindu-Arabic numerals I thought I needed a macro.   But then I learned from @Martyn that the Dynamic Replace tool will do what I needed.  And this is why one should always review other's solutions. 

Asteroid
Spoiler
challenge_183_shvive.png

Struggled a bit with evaluating the expression only to realise the wonder called Dynamic Replace. My answer matches to what almighty Google thinks so I'd like to believe I am on the right track even though the solution result seems to be way off from my answer. 

Alteryx Certified Partner

Finally, I understand why I've learned latin ... but I've got a different result.

 

Spoiler
30-09-_2019_18-29-56.png
I splitted the roman numeral to single characters, translated the characters, applied roman numeral logic (small number before a larger number => subtract, else add) and created a formula string.

30-09-_2019_18-30-12.png
I handed the formula string to a macro

30-09-_2019_18-33-30.png
Calculation result is different
30-09-_2019_18-34-21.png

 

 

Asteroid

After seeing you can interpret strings as formulas in @Martyn 's solution I went in and modified the end of my workflow to incorporate what I learned from him. 

Spoiler
ZhSOL2.png
Pulsar
Pulsar
Spoiler
Mine isn't dynamic enough to pick up if the order of operations is in the incorrect order, but does the job here.
Also getting 15,197

Capture.PNG