There is no need to use conditional statement?
like this return code, if it gives boolean itself, doesn't need to use conditional statement, right?
Same here!! I was surprised when I saw this super simple line of code! I'm sure after some practice we will be able to think these solutions as well!! ✌🏻
I'm brand spanking new to coding (two weeks of self-studying) and seeing stuff like this is motivational.
I love seeing the different ways people think and approach problems--and how SIMPLE some code can be because of it.
I see XOR logic, good thinking.
Chorono79 toxic user
You're right, probably better performance.
Sorry about that. I'm not familiar about this system.
Why not marking your coment as having spoiler content?
This comment is hidden because it contains spoiler information about the solution
After three years, it's been fixed or it ain't gonna be fixed.
1.25 * 7.8 = 9.75 NOT 9.85 as the example shows. Just so you know.
Not quite right. A recursive solution like this is exponential (at least 1.6^n). O(n) is actually very good.
Recursion would really be bad for big n, but since the return value is int you shouldn't expect values for n larger than 46.