Created
July 10, 2019 17:55
-
-
Save Cyborg-Model-Z/0cbcd43edd4b77e0835fa1e3d03b4649 to your computer and use it in GitHub Desktop.
count number of odds below n
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @camsbury this is a 7 kyu and I think I'm pretty damn close, even divided it into two as you recommended, but this is timing out for some reason | |
| ```def odd_or_even(n): | |
| if(n) % 2 == 0: | |
| return n-1 | |
| else: | |
| return n-2 | |
| def count_to(n): | |
| while n>0: | |
| lst = [] | |
| lst.append(n) | |
| n-2 | |
| def odd_count(n): | |
| n=(count_to(odd_or_even(n))) | |
| ``` |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nope it's 8 kyu : /