Created
October 21, 2022 21:57
-
-
Save Tokiyomi/fcbb528fa792d9ec2c0f592a9d0b6365 to your computer and use it in GitHub Desktop.
powers of two in python
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
# Python Solution | |
def powers_of_two(N): | |
""" | |
This function generates my proposed tactical N sets of numbers made of powers of 2 | |
and the remaining N-30 numbers will be the last N numbers before 10**9 inclusive. | |
As N is always 100, this fuction is always performed without problems | |
""" | |
A = [2**i for i in range(30)] + [10**9 - n for n in range(N-30)] | |
return A |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment