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.
If you add
print(entered_code, correct_code)
, you will be able to see what the inputs are in the console log. You might get a hint from there.This comment is hidden because it contains spoiler information about the solution
Sum them up and you'll get 256686.
No way :p
But why should equal 256686?
All multiples of 1 below 717 are:
1, 2, 3, ... ,716
. Sum them all up and you'll get that number, not 717.Darn it, I fixed the issue I had before but now I got this:
Testing for n=1, m=717
Should work for random inputs: 717 should equal 256686
Why?
Thanks a lot! :)
i see, thank you
Here, n = 4 and m = 123.
As for the conditions 'm' is exclusive so 'm' is not included incase it is multiple of 'n'
123 isn't a multiple of 4 so our example will contain [ 4, 8, 12, 16, 20, ...., 120 ] as the final set of
all the multiples of 4 smaller than 123. Now just find the answer by adding all the elements i.e. 1860
It is because incase n>m it will execute the else block on the 7th line of the code.
You can add a extra check when n>m so that it will return "INVALID"
Can someone tell me what are n and m for the first Basic Example where the output should be 1860?
This is the only one that I'm stuck with...
Nice, clear and simple. I like it a LOT!
This comment is hidden because it contains spoiler information about the solution
Lol me neither... I went for importing re
Loading more items...