Created
September 23, 2017 19:54
-
-
Save scdekov/bd3cfbc2d9a015c9010b6dd9ac86b108 to your computer and use it in GitHub Desktop.
This file contains 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
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