Well this was fun, but I took way too much time to figure out generating the combinations so the final part isn't as dynamic as I'd like.
Manually reconstructed the sentence/calc rather than having the input be dynamic to a different puzzle. Spent a good 2 hours on it though so time to be content with a working solution and move on! Still quite brute force but runs in <15 mins.
Tough challenge! Took me some time to figure out how to streamline the brute force approach.
Method 1: Brute Force - go through all combinations until match
Method 2: using Brute Force with conditions
We have two conditions:
1. unique values
2. the equation has to fit
The second condition can be broken down to:
1. the last digits follow: mod(D+E,10)=Y
2. the following digits follow e.g. mod(N+R+carryOver,10)=E
Repeating these conditions for each digit position limits the combinations to check by a huge margin.