Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Cyborg-Model-Z/0cbcd43edd4b77e0835fa1e3d03b4649 to your computer and use it in GitHub Desktop.

Select an option

Save Cyborg-Model-Z/0cbcd43edd4b77e0835fa1e3d03b4649 to your computer and use it in GitHub Desktop.
count number of odds below n
@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)))
```
@Cyborg-Model-Z
Copy link
Author

Nope it's 8 kyu : /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment