Last active
March 11, 2021 00:42
-
-
Save viniciusarre/7c0e7c4c1ec0a4ef09b10863ca276459 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
| # Shorter solution | |
| def bounded_ratio(a, l, r): | |
| for i, v in enumerate(a): | |
| for x in range(l, r + 1): | |
| yield (i + 1) * x == v | |
| v = (1, 2, 3, 4, 5) | |
| r = l = 1 | |
| print(list(bounded_ratio(v, l, r))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment