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 is amazing. Is it in Python?
Sure! Thanks a lot!
It works without return because the sample test (scroll a bit to see it in the coding page) tries to call factorial(). Talking about what he imported from math, factorial, it is imported as a function after all. Hope you get it.
This comment is hidden because it contains spoiler information about the solution
And... Why it works without a return (nor even rest of the code)? :/
Why did I not think of this...
It's a horrible idea to use try/except for completely preventable exceptions.
Use spoiler flag if your comment contains info about solution.
Cybersamurai, wdym? It works perfectly, I just tried it.
Please mark your post as having spoiler content next time. Your post was visible in the homepage discourse.
This comment is hidden because it contains spoiler information about the solution
The problem states that the array has every integer from 1 to n exactly once except for some integer in between, which appears twice. The array that you're testing on doesn't fit this description (it has a 9 but no 6, for example), so the solution doesn't work.
I tried this with: arr = [1, 5, 7, 3, 2, 9, 2, 8]
And it returned 9 instead of 2 :/
can I strike my answer from ever having existed? is what I thought when I saw this
Loading more items...