Last active
March 11, 2021 00:41
-
-
Save viniciusarre/1365254e8760e8aebbc9abd909154355 to your computer and use it in GitHub Desktop.
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
| # Better sollution | |
| def main(): | |
| v = (1, 2, 3, 4, 5) | |
| r = l = 1 | |
| print(bounded_ratio(v, l, r)) | |
| def bounded_ratio(a, l, r): | |
| values = [] | |
| for i, v in enumerate(a): | |
| values = values + [(i + 1) * x == v for x in range(l, r + 1)] | |
| return values | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment