Last active
March 3, 2020 20:06
-
-
Save ahmed4end/90f767bea9e42018f33fd666910a288f 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
import numpy as np | |
text = "attack postponed untill two am".replace(' ','') | |
key = 4312567 | |
sliced = [ int(k) for k in str(key) ] | |
least_cells = lambda x=1: ( x,len(sliced) ) if x*len(sliced) >= len(text) else least_cells(x+1) | |
print(np.reshape(np.array(['x']*(lambda x,y: x*y)(*least_cells())) , least_cells())) | |
#OR | |
print(np.reshape(np.array(['x']*(least_cells()[0]*least_cells()[1])) , least_cells())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment