This comment is hidden because it contains spoiler information about the solution
It's easy with regex. Plus, I don't think this is Kyu 8. The author thought of what? 17 if else statements? lol He/She should've put it as a dict...
One liners aren't common practice in production. Hard to read, prone to bugs. You really don't need a for loop here as you mainly need to specify the larger of the two numbers (math is weird I know) and run the SUM for the numbers in the RANGE.
Looking back, I can't say why the code was accepted at the time. I tried this code today, now the code is too slow. maybe the tests were changed.
Loading collection data...
This comment is hidden because it contains spoiler information about the solution
It's easy with regex. Plus, I don't think this is Kyu 8. The author thought of what?
17 if else statements? lol
He/She should've put it as a dict...
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
One liners aren't common practice in production. Hard to read, prone to bugs. You really don't need a for loop here as you mainly need to specify the larger of the two numbers (math is weird I know) and run the SUM for the numbers in the RANGE.
This comment is hidden because it contains spoiler information about the solution
Looking back, I can't say why the code was accepted at the time. I tried this code today, now the code is too slow. maybe the tests were changed.
This comment is hidden because it contains spoiler information about the solution