Skip to content

Instantly share code, notes, and snippets.

@Tokiyomi
Created October 21, 2022 21:57
Show Gist options
  • Save Tokiyomi/fcbb528fa792d9ec2c0f592a9d0b6365 to your computer and use it in GitHub Desktop.
Save Tokiyomi/fcbb528fa792d9ec2c0f592a9d0b6365 to your computer and use it in GitHub Desktop.
powers of two in python
# 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