Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Sum of subsets (Python)
import numpy as np k = 3 A = [ 1, 2, 3, 4, 5 ] kk = min( len( A ), k ) + 1 S = np.zeros( kk, dtype=int ); S[0] = 1 for a in A: S[1:kk] = S[1:kk] + a * S[0:kk-1] print( S.sum() - 1 )
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
cls_var und cls_method
Kim
Lesson 8 updated
kenken1
Distance between latititude and longitude
Game4
https://rextester.com/OSAX55060
func1
contoh 3.1
My wall
Please log in to post a comment.