-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize Elixir solution 145 #34
Comments
For reference, these are the first few numbers that are reversible:
They look like they follow a regular pattern, but I haven't looked too much into it yet. For starters, the first and last digits must be of different parity, in order for the resulting addition to be an odd number... |
We can also identify that in 3-digit numbers, the sum of (first digit + last digit) must result in over than 10, in order for the carry-on digit to make the middle digit odd. For example: For that reason, there are no reversible numbers between 100 and 200. |
I don't know anything about
If you reach 49, the reverse is 94 and you don't need to run from 1 to 100, just from 1 to 50, because when you pass to 50+ numbers, you already counted them. You can try cutting by half just doing this if my assumption is correct. For tests issues, you can use smaller numbers and see if works. I don't know if that approach is possible considering that What do you think? |
I think it's possible. |
Hey guys, I've just opened #33 which consists of the elixir solution for problem 145.
Unfortunately it is very badly optimized for now, taking 30 min to compute.
If anybody has any suggestion for improvement, I'd be happy to test it out! 😄
Thanks!
The text was updated successfully, but these errors were encountered: