Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #183: Roman Numeral Math

AYXAcademy
Alteryx
Alteryx

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

 

AnandKumar1
8 - Asteroid

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

 

LordNeilLord
15 - Aurora

I've been waiting for this one to come up 🙂

Martyn
9 - Comet

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

 

Spoiler
image.png
ZenonH
8 - 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

David-Carnes
12 - Quasar

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. 

viveknshah
8 - 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. 

RolandSchubert
16 - Nebula
16 - Nebula

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

 

 

ZenonH
8 - 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
Kenda
16 - Nebula
16 - Nebula
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