Skip to content

Instantly share code, notes, and snippets.

@scdekov
Created September 23, 2017 19:54
Show Gist options
  • Save scdekov/bd3cfbc2d9a015c9010b6dd9ac86b108 to your computer and use it in GitHub Desktop.
Save scdekov/bd3cfbc2d9a015c9010b6dd9ac86b108 to your computer and use it in GitHub Desktop.
def can_rotate(time, start, end):
if time > end:
return False
return end % time <= end - start
def count_birds(times, start, end):
res = 0
for time in times:
res += int(can_rotate(time, start, end))
return res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment