Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
A lot of uneccessary work, I bet this is a very slow solution!
This comment is hidden because it contains spoiler information about the solution
Wow , you managed to put a recursive function call in use for this simple problem!
No need to include these headers and increase the bytesize of your source code and of your executable!
You only make a function here, not a full main() , and this function does not print anything (so no need to stdio.h)
and does not use strings (so no need to string.h )
I approached the problem in a similar way (without needing to use cmath header), but I took care of the edge cases for which
n < 4 , by returning false , and for n>=4 i iterate from i=2 until i< n/2 , so I avoide having a hard coded number like 1000
similar to mine! But no need to include <stdio.h> since there is no printf() or any other such function. You increase the size of your executable for no reason by including stdio.h
I like how you avoid using a variable sum , and instead just decrement total!
I suppose this will be a slow run, it has to perform an if-else for every i, and also use break, I am not sure how much time all these cost.
Too many variables are declared and used! not needed