Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEAChose a brute force method - good fun.
Really interesting.
A great challenge, for the first part the logic was to split the characters (used regex "."), add them and raised to the power of the length of original number. For the second part it was a bit tricky but a formula tool with an if function worked fine reducing the power by (1) each time
This challenge , it took a while to understand and frame my approach to solving it. But i was unable to get the solution. I checked the solution available. moving forward i need to practice a lot.
Simplest RegEx ever to the rescue
Solution has some extra logic up front to test if the nth root is an integer. This lets us throw out most values before we parse strings to get sum of numbers.
Don't know how much that actually speeds things up for this example, but I like to optimize for execution time where possible and generally workflow tools are fast and RegEx is slow so we try to move the load off of the RegEx operation, even if this is the simplest possible RegEx.
As a bonus, structuring the problem this way made the extra credit easy. Once you're calculating nth roots, you just have to test all n<=length rather than just n=length and that sounds like a job for generate rows.